From 9247bc8b79a04493ce80f101e75eb79ae06e7588 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Fri, 18 Sep 2020 17:55:31 +1200 Subject: [PATCH 1/2] NEW: Add Symfony 4 support alongside Symfony 3 - Remove duplicate key in YML file - Remove deprecated yaml dump indentation set (the constructor arg works in both ^3 and ^4) Fixes #9274 --- composer.json | 8 ++++---- src/i18n/Messages/YamlWriter.php | 3 +-- tests/php/ORM/DataObjectTest.yml | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index f8b2ef8c9..746624526 100644 --- a/composer.json +++ b/composer.json @@ -37,10 +37,10 @@ "silverstripe/vendor-plugin": "^1.4", "sminnee/callbacklist": "^0.1", "swiftmailer/swiftmailer": "~5.4", - "symfony/cache": "^3.3@dev", - "symfony/config": "^3.2", - "symfony/translation": "^2.8", - "symfony/yaml": "~3.2", + "symfony/cache": "^3.3 || ^4", + "symfony/config": "^3.2 || ^4", + "symfony/translation": "^2.8 || ^3 || ^4", + "symfony/yaml": "^3.2 || ^4", "php": ">=7.1.0", "ext-ctype": "*", "ext-dom": "*", diff --git a/src/i18n/Messages/YamlWriter.php b/src/i18n/Messages/YamlWriter.php index d5917f977..14a6b47ae 100644 --- a/src/i18n/Messages/YamlWriter.php +++ b/src/i18n/Messages/YamlWriter.php @@ -29,8 +29,7 @@ class YamlWriter implements Writer protected function getDumper() { if (!$this->dumper) { - $this->dumper = new Dumper(); - $this->dumper->setIndentation(2); + $this->dumper = new Dumper(2); } return $this->dumper; } diff --git a/tests/php/ORM/DataObjectTest.yml b/tests/php/ORM/DataObjectTest.yml index 242eceba8..b55c6811a 100644 --- a/tests/php/ORM/DataObjectTest.yml +++ b/tests/php/ORM/DataObjectTest.yml @@ -143,7 +143,7 @@ SilverStripe\ORM\Tests\DataObjectTest\Company: company1: Name: Company corp Owner: =>SilverStripe\ORM\Tests\DataObjectTest\Player.player1 - company1: + company2: Name: 'Team co.' Owner: =>SilverStripe\ORM\Tests\DataObjectTest\Player.player2 SilverStripe\ORM\Tests\DataObjectTest\Bracket: From 8b3ef8f85ae7a738fa2e8cfe217aca6274477117 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Fri, 18 Sep 2020 18:52:56 +1200 Subject: [PATCH 2/2] FIX: recipe-testing is only needed for behat. The other dependencies that are required are already included in require-dev. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3ade7065a..562fd7022 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,7 +86,7 @@ before_script: - mkdir ./public - if [[ $DB == PGSQL ]]; then composer require silverstripe/postgresql:2.x-dev --no-update; fi - if [[ $DB == SQLITE ]]; then composer require silverstripe/sqlite3:2.x-dev --no-update; fi - - composer require silverstripe/recipe-testing:^1 silverstripe/recipe-core:4.x-dev silverstripe/admin:1.x-dev silverstripe/versioned:1.x-dev --no-update + - composer require silverstripe/recipe-core:4.x-dev silverstripe/admin:1.x-dev silverstripe/versioned:1.x-dev --no-update - if [[ $PHPUNIT_TEST == cms ]]; then composer require silverstripe/recipe-cms:4.x-dev --no-update; fi - if [[ $PHPCS_TEST ]]; then composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o; fi - composer update --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile $COMPOSER_INSTALL_ARG