From f56aa9b55386d4f8f7dd82e88af0eed04622d28a Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Tue, 7 May 2019 09:44:59 +0200 Subject: [PATCH 01/15] Updated unit tests --- .travis.yml | 7 ++++-- Tests/DatatableTest.php | 35 ++++++++++++------------------ Tests/Datatables/PostDatatable.php | 29 +++++++++++++++++++++++++ composer.json | 6 +++++ 4 files changed, 54 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 15ea59f7..ebf7ea17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,19 +11,22 @@ matrix: include: - php: 7.1 env: DEPENDENCIES=beta + - php: 7.2 + env: DEPENDENCIES=beta + - php: 7.3 + env: DEPENDENCIES=beta - php: hhvm allow_failures: - php: hhvm env: - - SYMFONY_VERSION="3.0.*" DEPENDENCIES=dev COMPOSER_FLAGS="--prefer-stable" + - SYMFONY_VERSION="3.4.*" DEPENDENCIES=dev COMPOSER_FLAGS="--prefer-stable" before_install: - composer self-update - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; - if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/framework-bundle=$SYMFONY_VERSION; fi - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi; - - composer require --dev "phpunit/phpunit=5.7.*" install: composer update --prefer-dist --no-interaction $COMPOSER_FLAGS diff --git a/Tests/DatatableTest.php b/Tests/DatatableTest.php index 7032df39..662520a9 100644 --- a/Tests/DatatableTest.php +++ b/Tests/DatatableTest.php @@ -11,14 +11,14 @@ namespace Sg\DatatablesBundle\Tests; +use Doctrine\ORM\EntityManager; +use Doctrine\ORM\Mapping\ClassMetadata; use Sg\DatatablesBundle\Tests\Datatables\PostDatatable; - use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Routing\RouterInterface; -use Doctrine\ORM\EntityManager; -use Twig_Environment; +use Twig\Environment; /** * Class DatatableTest @@ -35,28 +35,22 @@ public function testCreate() $tableClass = PostDatatable::class; /** @noinspection PhpUndefinedMethodInspection */ - $authorizationChecker = $this->getMock(AuthorizationCheckerInterface::class); + $authorizationChecker = $this->createMock(AuthorizationCheckerInterface::class); /** @noinspection PhpUndefinedMethodInspection */ - $securityToken = $this->getMock(TokenStorageInterface::class); + $securityToken = $this->createMock(TokenStorageInterface::class); /** @noinspection PhpUndefinedMethodInspection */ - $translator = $this->getMock(TranslatorInterface::class); + $translator = $this->createMock(TranslatorInterface::class); /** @noinspection PhpUndefinedMethodInspection */ - $router = $this->getMock(RouterInterface::class); + $router = $this->createMock(RouterInterface::class); /** @noinspection PhpUndefinedMethodInspection */ - $twig = $this->getMock(Twig_Environment::class); - + $twig = $this->createMock(Environment::class); /** @noinspection PhpUndefinedMethodInspection */ - $em = $this->getMockBuilder(EntityManager::class) - ->disableOriginalConstructor() - ->setMethods( - array('getClassMetadata') - ) - ->getMock(); + $em = $this->createMock(EntityManager::class); /** @noinspection PhpUndefinedMethodInspection */ $em->expects($this->any()) ->method('getClassMetadata') - ->will($this->returnValue($this->getClassMetadataMock())); + ->willReturn($this->getClassMetadataMock()); /** @var \Sg\DatatablesBundle\Tests\Datatables\PostDatatable $table */ $table = new $tableClass($authorizationChecker, $securityToken, $translator, $router, $em, $twig); @@ -75,15 +69,14 @@ public function testCreate() public function getClassMetadataMock() { /** @noinspection PhpUndefinedMethodInspection */ - $mock = $this->getMockBuilder('Doctrine\ORM\Mapping\ClassMetadata') - ->disableOriginalConstructor() - ->setMethods(array('getEntityShortName')) - ->getMock(); + $mock = $this->createPartialMock(ClassMetadata::class, [ + 'getEntityShortName' + ]); /** @noinspection PhpUndefinedMethodInspection */ $mock->expects($this->any()) ->method('getEntityShortName') - ->will($this->returnValue('{entityShortName}')); + ->willReturn('{entityShortName}'); return $mock; } diff --git a/Tests/Datatables/PostDatatable.php b/Tests/Datatables/PostDatatable.php index 68247977..1403e924 100644 --- a/Tests/Datatables/PostDatatable.php +++ b/Tests/Datatables/PostDatatable.php @@ -12,7 +12,13 @@ namespace Sg\DatatablesBundle\Tests\Datatables; use Sg\DatatablesBundle\Datatable\AbstractDatatable; +use Sg\DatatablesBundle\Datatable\Column\ActionColumn; +use Sg\DatatablesBundle\Datatable\Column\BooleanColumn; use Sg\DatatablesBundle\Datatable\Column\Column; +use Sg\DatatablesBundle\Datatable\Column\DateTimeColumn; +use Sg\DatatablesBundle\Datatable\Column\ImageColumn; +use Sg\DatatablesBundle\Datatable\Column\NumberColumn; +use Sg\DatatablesBundle\Datatable\Column\VirtualColumn; /** * Class PostDatatable @@ -42,6 +48,29 @@ public function buildDatatable(array $options = array()) ->add('title', Column::class, array( 'title' => 'Title', )) + ->add('boolean', BooleanColumn::class, array( + 'title' => 'Boolean', + )) + ->add('datetime', DateTimeColumn::class, array( + 'title' => 'DateTimeColumn', + )) + ->add('image', ImageColumn::class, array( + 'title' => 'ImageColumn', + 'imagine_filter' => '', + 'relative_path' => '', + )) + ->add(null, ActionColumn::class, array( + 'title' => 'ActionColumn', + 'actions' => [ + ] + )) + ->add('number', NumberColumn::class, array( + 'title' => 'NumberColumn', + 'formatter' => new \NumberFormatter('en_US', \NumberFormatter::DECIMAL) + )) + ->add('virtual', VirtualColumn::class, array( + 'title' => 'VirtualColumn', + )) ; } diff --git a/composer.json b/composer.json index ba09f919..cae56867 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,12 @@ "symfony/property-access": "^3.0|^4.0", "friendsofsymfony/jsrouting-bundle": "^1.6|^2.0" }, + "require-dev": { + "phpunit/phpunit": "5.7.*", + "symfony/security": "^4.2", + "symfony/translation": "^4.2", + "twig/twig": "^2.9" + }, "autoload": { "psr-4": { "Sg\\DatatablesBundle\\": "" } } From a19d53e5c9e7ab2901266475e6b190efd0a22fa3 Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Tue, 7 May 2019 10:07:57 +0200 Subject: [PATCH 02/15] Removed php 7.1, added Symfony 4.2 env --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ebf7ea17..561727a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,12 +9,14 @@ cache: matrix: fast_finish: true include: - - php: 7.1 - env: DEPENDENCIES=beta - php: 7.2 env: DEPENDENCIES=beta + - php: 7.2 + env: DEPENDENCIES=beta SYMFONY_VERSION="4.2.*" - php: 7.3 env: DEPENDENCIES=beta + - php: 7.3 + env: DEPENDENCIES=beta SYMFONY_VERSION="4.2.*" - php: hhvm allow_failures: - php: hhvm From 0d20e0a5fb97936b703e672d360c2258ced87c31 Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Tue, 7 May 2019 10:11:50 +0200 Subject: [PATCH 03/15] Symfony deps fix --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 561727a8..de5a3039 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ env: before_install: - composer self-update - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; - - if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/framework-bundle=$SYMFONY_VERSION; fi + - if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/security=$SYMFONY_VERSION symfony/translation=$SYMFONY_VERSION symfony/framework-bundle=$SYMFONY_VERSION; fi - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi; install: composer update --prefer-dist --no-interaction $COMPOSER_FLAGS From 926a9fa163f7b764b8b95edde7ad709bb28aa7cc Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Tue, 7 May 2019 10:17:44 +0200 Subject: [PATCH 04/15] remove php 7.1 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index cae56867..5c0d3bcf 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "issues": "https://github.com/stwe/DatatablesBundle/issues" }, "require": { - "php": ">=7.1", + "php": ">=7.2", "symfony/framework-bundle": "^3.0|^4.0", "doctrine/orm": "^2.5", "symfony/options-resolver": "^3.0|^4.0", @@ -27,8 +27,8 @@ }, "require-dev": { "phpunit/phpunit": "5.7.*", - "symfony/security": "^4.2", - "symfony/translation": "^4.2", + "symfony/security": "^3.0|^4.0", + "symfony/translation": "^3.0|^4.0", "twig/twig": "^2.9" }, "autoload": { From 20c3deb72f5d9c316fd36bb815891fbea17aef33 Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Tue, 7 May 2019 10:22:12 +0200 Subject: [PATCH 05/15] Dropped support for Symfony <3.4 and 4.0 --- .travis.yml | 4 ++-- composer.json | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index de5a3039..2a1eb5a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,11 @@ matrix: fast_finish: true include: - php: 7.2 - env: DEPENDENCIES=beta + env: DEPENDENCIES=beta SYMFONY_VERSION="3.4.*" - php: 7.2 env: DEPENDENCIES=beta SYMFONY_VERSION="4.2.*" - php: 7.3 - env: DEPENDENCIES=beta + env: DEPENDENCIES=beta SYMFONY_VERSION="3.4.*" - php: 7.3 env: DEPENDENCIES=beta SYMFONY_VERSION="4.2.*" - php: hhvm diff --git a/composer.json b/composer.json index 5c0d3bcf..7fa0eb0f 100644 --- a/composer.json +++ b/composer.json @@ -19,16 +19,16 @@ }, "require": { "php": ">=7.2", - "symfony/framework-bundle": "^3.0|^4.0", + "symfony/framework-bundle": "^3.4|^4.1", "doctrine/orm": "^2.5", - "symfony/options-resolver": "^3.0|^4.0", - "symfony/property-access": "^3.0|^4.0", + "symfony/options-resolver": "^3.0|^4.1", + "symfony/property-access": "^3.0|^4.1", "friendsofsymfony/jsrouting-bundle": "^1.6|^2.0" }, "require-dev": { "phpunit/phpunit": "5.7.*", - "symfony/security": "^3.0|^4.0", - "symfony/translation": "^3.0|^4.0", + "symfony/security": "^3.4|^4.1", + "symfony/translation": "^3.4|^4.1", "twig/twig": "^2.9" }, "autoload": { From 5419803fc174c3873ca1c8984d87b42126977055 Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Tue, 7 May 2019 11:30:53 +0200 Subject: [PATCH 06/15] Support 7.1 because it's not EOL yet. --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 7fa0eb0f..a2a18a33 100644 --- a/composer.json +++ b/composer.json @@ -18,11 +18,11 @@ "issues": "https://github.com/stwe/DatatablesBundle/issues" }, "require": { - "php": ">=7.2", + "php": ">=7.1", "symfony/framework-bundle": "^3.4|^4.1", "doctrine/orm": "^2.5", - "symfony/options-resolver": "^3.0|^4.1", - "symfony/property-access": "^3.0|^4.1", + "symfony/options-resolver": "^3.4|^4.1", + "symfony/property-access": "^3.4|^4.1", "friendsofsymfony/jsrouting-bundle": "^1.6|^2.0" }, "require-dev": { From b7e0e8a4864b850065a68934ae80454d160a319b Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Mon, 26 Aug 2019 15:58:48 +0200 Subject: [PATCH 07/15] php-cs-fixer --- Tests/DatatableTest.php | 9 +++++---- Tests/Datatables/PostDatatable.php | 28 ++++++++++++++-------------- composer.json | 4 +--- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Tests/DatatableTest.php b/Tests/DatatableTest.php index a115502e..5de5dda4 100644 --- a/Tests/DatatableTest.php +++ b/Tests/DatatableTest.php @@ -12,12 +12,11 @@ namespace Sg\DatatablesBundle\Tests; use Doctrine\ORM\EntityManager; -use Doctrine\ORM\Mapping\ClassMetadata; use Sg\DatatablesBundle\Tests\Datatables\PostDatatable; +use Symfony\Component\Routing\RouterInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; use Symfony\Component\Translation\TranslatorInterface; -use Symfony\Component\Routing\RouterInterface; use Twig_Environment; /** @@ -56,7 +55,8 @@ public function testCreate() // @noinspection PhpUndefinedMethodInspection $em->expects(static::any()) ->method('getClassMetadata') - ->willReturn($this->getClassMetadataMock()); + ->willReturn($this->getClassMetadataMock()) + ; /** @var \Sg\DatatablesBundle\Tests\Datatables\PostDatatable $table */ $table = new $tableClass($authorizationChecker, $securityToken, $translator, $router, $em, $twig); @@ -79,7 +79,8 @@ public function getClassMetadataMock() // @noinspection PhpUndefinedMethodInspection $mock->expects(static::any()) ->method('getEntityShortName') - ->willReturn('{entityShortName}'); + ->willReturn('{entityShortName}') + ; return $mock; } diff --git a/Tests/Datatables/PostDatatable.php b/Tests/Datatables/PostDatatable.php index ad7e90c4..abb4c087 100644 --- a/Tests/Datatables/PostDatatable.php +++ b/Tests/Datatables/PostDatatable.php @@ -43,29 +43,29 @@ public function buildDatatable(array $options = []) ->add('title', Column::class, [ 'title' => 'Title', ]) - ->add('boolean', BooleanColumn::class, array( + ->add('boolean', BooleanColumn::class, [ 'title' => 'Boolean', - )) - ->add('datetime', DateTimeColumn::class, array( + ]) + ->add('datetime', DateTimeColumn::class, [ 'title' => 'DateTimeColumn', - )) - ->add('image', ImageColumn::class, array( + ]) + ->add('image', ImageColumn::class, [ 'title' => 'ImageColumn', 'imagine_filter' => '', 'relative_path' => '', - )) - ->add(null, ActionColumn::class, array( + ]) + ->add(null, ActionColumn::class, [ 'title' => 'ActionColumn', 'actions' => [ - ] - )) - ->add('number', NumberColumn::class, array( + ], + ]) + ->add('number', NumberColumn::class, [ 'title' => 'NumberColumn', - 'formatter' => new \NumberFormatter('en_US', \NumberFormatter::DECIMAL) - )) - ->add('virtual', VirtualColumn::class, array( + 'formatter' => new \NumberFormatter('en_US', \NumberFormatter::DECIMAL), + ]) + ->add('virtual', VirtualColumn::class, [ 'title' => 'VirtualColumn', - )) + ]) ; } diff --git a/composer.json b/composer.json index 3f459bbe..e336dee3 100644 --- a/composer.json +++ b/composer.json @@ -27,14 +27,12 @@ }, "require-dev": { "phpunit/phpunit": "5.7.*", + "friendsofphp/php-cs-fixer": "^2.15", "symfony/security": "^3.4|^4.1", "symfony/translation": "^3.4|^4.1", "twig/twig": "^2.9" }, "autoload": { "psr-4": { "Sg\\DatatablesBundle\\": "" } - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.15" } } From b56ac90664d1b3086f9e9d83912aa338b0ee551f Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Mon, 26 Aug 2019 16:16:44 +0200 Subject: [PATCH 08/15] php-cs-fixer --- Datatable/Filter/SelectFilter.php | 2 +- Tests/Column/ArrayColumnTest.php | 6 ------ Tests/DatatableTest.php | 3 --- Tests/Datatables/PostDatatable.php | 4 ++++ Tests/Response/DatatableQueryBuilderTest.php | 8 +------- 5 files changed, 6 insertions(+), 17 deletions(-) diff --git a/Datatable/Filter/SelectFilter.php b/Datatable/Filter/SelectFilter.php index ca76f067..d6d38031 100644 --- a/Datatable/Filter/SelectFilter.php +++ b/Datatable/Filter/SelectFilter.php @@ -171,7 +171,7 @@ public function setMultiple($multiple) /** * @throws Exception */ - private function setSelectSearchType(string $searchValue) + private function setSelectSearchType(string $searchValue): void { $searchTypesCount = \count($this->selectSearchTypes); diff --git a/Tests/Column/ArrayColumnTest.php b/Tests/Column/ArrayColumnTest.php index 682797e0..9a7423f9 100644 --- a/Tests/Column/ArrayColumnTest.php +++ b/Tests/Column/ArrayColumnTest.php @@ -19,9 +19,6 @@ */ final class ArrayColumnTest extends \PHPUnit\Framework\TestCase { - /** - * testCreate. - */ public function testIsAssociative() { $arrayColumn = new ArrayColumn(); @@ -29,9 +26,6 @@ public function testIsAssociative() static::assertTrue($this->callMethod($arrayColumn, 'isAssociative', [['a' => 1, 'b' => 1]])); } - /** - * testCreate. - */ public function testArrayToString() { $arrayColumn = new ArrayColumn(); diff --git a/Tests/DatatableTest.php b/Tests/DatatableTest.php index 5de5dda4..360134aa 100644 --- a/Tests/DatatableTest.php +++ b/Tests/DatatableTest.php @@ -25,9 +25,6 @@ */ final class DatatableTest extends \PHPUnit\Framework\TestCase { - /** - * testCreate. - */ public function testCreate() { $tableClass = PostDatatable::class; diff --git a/Tests/Datatables/PostDatatable.php b/Tests/Datatables/PostDatatable.php index abb4c087..06462486 100644 --- a/Tests/Datatables/PostDatatable.php +++ b/Tests/Datatables/PostDatatable.php @@ -13,6 +13,7 @@ use Sg\DatatablesBundle\Datatable\AbstractDatatable; use Sg\DatatablesBundle\Datatable\Column\ActionColumn; +use Sg\DatatablesBundle\Datatable\Column\AttributeColumn; use Sg\DatatablesBundle\Datatable\Column\BooleanColumn; use Sg\DatatablesBundle\Datatable\Column\Column; use Sg\DatatablesBundle\Datatable\Column\DateTimeColumn; @@ -46,6 +47,9 @@ public function buildDatatable(array $options = []) ->add('boolean', BooleanColumn::class, [ 'title' => 'Boolean', ]) + ->add('attribute', AttributeColumn::class, [ + 'title' => 'Attribute', + ]) ->add('datetime', DateTimeColumn::class, [ 'title' => 'DateTimeColumn', ]) diff --git a/Tests/Response/DatatableQueryBuilderTest.php b/Tests/Response/DatatableQueryBuilderTest.php index 568ee2e2..0cd77230 100644 --- a/Tests/Response/DatatableQueryBuilderTest.php +++ b/Tests/Response/DatatableQueryBuilderTest.php @@ -100,13 +100,7 @@ public function testUsingTheSortNameWhenShortNameIsNotAReservedWord() $this->getDataTableQueryBuilder($entityName, $shortName); } - /** - * @param string $entityName - * @param string $shortName - * - * @return DatatableQueryBuilder - */ - private function getDataTableQueryBuilder($entityName, $shortName) + private function getDataTableQueryBuilder(string $entityName, string $shortName): DatatableQueryBuilder { $this->reflectionClass->getShortName()->willReturn($shortName); $this->classMetadata->getReflectionClass()->willReturn($this->reflectionClass->reveal()); From 993e2d9169c854d87c2a9d245cca1c8e948c7b85 Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Tue, 27 Aug 2019 08:58:49 +0200 Subject: [PATCH 09/15] Upgrade 4.2 to 4.3 in travis. --- .travis.yml | 6 +++--- composer.json | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2a1eb5a5..292e6140 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,11 +12,11 @@ matrix: - php: 7.2 env: DEPENDENCIES=beta SYMFONY_VERSION="3.4.*" - php: 7.2 - env: DEPENDENCIES=beta SYMFONY_VERSION="4.2.*" + env: DEPENDENCIES=beta SYMFONY_VERSION="4.3.*" - php: 7.3 env: DEPENDENCIES=beta SYMFONY_VERSION="3.4.*" - php: 7.3 - env: DEPENDENCIES=beta SYMFONY_VERSION="4.2.*" + env: DEPENDENCIES=beta SYMFONY_VERSION="4.3.*" - php: hhvm allow_failures: - php: hhvm @@ -27,7 +27,7 @@ env: before_install: - composer self-update - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; - - if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/security=$SYMFONY_VERSION symfony/translation=$SYMFONY_VERSION symfony/framework-bundle=$SYMFONY_VERSION; fi + - if [ "$SYMFONY_VERSION" != "" ]; then composer config extra.symfony.require=$SYMFONY_VERSION; fi - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi; install: composer update --prefer-dist --no-interaction $COMPOSER_FLAGS diff --git a/composer.json b/composer.json index e336dee3..300981ac 100644 --- a/composer.json +++ b/composer.json @@ -23,6 +23,9 @@ "doctrine/orm": "^2.5", "symfony/options-resolver": "^3.4|^4.1", "symfony/property-access": "^3.4|^4.1", + "symfony/security": "^3.4|^4.1", + "symfony/translation": "^3.4|^4.1", + "symfony/framework-bundle": "^3.4|^4.1", "friendsofsymfony/jsrouting-bundle": "^1.6|^2.0" }, "require-dev": { @@ -34,5 +37,10 @@ }, "autoload": { "psr-4": { "Sg\\DatatablesBundle\\": "" } + }, + "extra": { + "symfony": { + "require": "^4.3.0" + } } } From c8525690f78ffb5d4bcdb519ad12f1dde648112f Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Tue, 27 Aug 2019 09:00:47 +0200 Subject: [PATCH 10/15] remove duplicate entry --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 300981ac..998197fe 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,6 @@ }, "require": { "php": ">=7.1", - "symfony/framework-bundle": "^3.4|^4.1", "doctrine/orm": "^2.5", "symfony/options-resolver": "^3.4|^4.1", "symfony/property-access": "^3.4|^4.1", From e98e675ac918258480b80d96a77f7a955f199760 Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Tue, 27 Aug 2019 09:07:20 +0200 Subject: [PATCH 11/15] typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 292e6140..f0e14e2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ env: before_install: - composer self-update - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; - - if [ "$SYMFONY_VERSION" != "" ]; then composer config extra.symfony.require=$SYMFONY_VERSION; fi + - if [ "$SYMFONY_VERSION" != "" ]; then composer config extra.symfony.require $SYMFONY_VERSION; fi - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi; install: composer update --prefer-dist --no-interaction $COMPOSER_FLAGS From e371af3b7714612c251f21dfc424110aa21be37a Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Tue, 27 Aug 2019 09:42:34 +0200 Subject: [PATCH 12/15] symfony flex doesn't work :( --- .travis.yml | 2 +- composer.json | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index f0e14e2d..d74e6b7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ env: before_install: - composer self-update - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; - - if [ "$SYMFONY_VERSION" != "" ]; then composer config extra.symfony.require $SYMFONY_VERSION; fi + - if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/framework-bundle=$SYMFONY_VERSION symfony/security=$SYMFONY_VERSION symfony/translation=$SYMFONY_VERSION; fi - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi; install: composer update --prefer-dist --no-interaction $COMPOSER_FLAGS diff --git a/composer.json b/composer.json index 998197fe..3423ca49 100644 --- a/composer.json +++ b/composer.json @@ -36,10 +36,5 @@ }, "autoload": { "psr-4": { "Sg\\DatatablesBundle\\": "" } - }, - "extra": { - "symfony": { - "require": "^4.3.0" - } } } From dfed745ec49d0510daf792509ace8aca618262f3 Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Wed, 28 Aug 2019 16:31:05 +0200 Subject: [PATCH 13/15] use Symfony Flex to install specific Symfony version --- .travis.yml | 12 ++++++------ composer.json | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index d74e6b7e..46b5ca44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,13 +10,13 @@ matrix: fast_finish: true include: - php: 7.2 - env: DEPENDENCIES=beta SYMFONY_VERSION="3.4.*" + env: DEPENDENCIES=beta SYMFONY_REQUIRE="3.4.*" - php: 7.2 - env: DEPENDENCIES=beta SYMFONY_VERSION="4.3.*" + env: DEPENDENCIES=beta SYMFONY_REQUIRE="4.3.*" - php: 7.3 - env: DEPENDENCIES=beta SYMFONY_VERSION="3.4.*" + env: DEPENDENCIES=beta SYMFONY_REQUIRE="3.4.*" - php: 7.3 - env: DEPENDENCIES=beta SYMFONY_VERSION="4.3.*" + env: DEPENDENCIES=beta SYMFONY_REQUIRE="4.3.*" - php: hhvm allow_failures: - php: hhvm @@ -26,8 +26,8 @@ env: before_install: - composer self-update - - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; - - if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/framework-bundle=$SYMFONY_VERSION symfony/security=$SYMFONY_VERSION symfony/translation=$SYMFONY_VERSION; fi + - composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master + - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi; install: composer update --prefer-dist --no-interaction $COMPOSER_FLAGS diff --git a/composer.json b/composer.json index 3423ca49..24d81b46 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,8 @@ "symfony/security": "^3.4|^4.1", "symfony/translation": "^3.4|^4.1", "symfony/framework-bundle": "^3.4|^4.1", - "friendsofsymfony/jsrouting-bundle": "^1.6|^2.0" + "friendsofsymfony/jsrouting-bundle": "^1.6|^2.0", + "symfony/flex": "^1.4" }, "require-dev": { "phpunit/phpunit": "5.7.*", From f7d8c9c0347355cd0334b5a80fe6272f4349efcd Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Wed, 28 Aug 2019 16:31:34 +0200 Subject: [PATCH 14/15] missed var --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 46b5ca44..5d1112dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ matrix: - php: hhvm env: - - SYMFONY_VERSION="3.4.*" DEPENDENCIES=dev COMPOSER_FLAGS="--prefer-stable" + - SYMFONY_REQUIRE="3.4.*" DEPENDENCIES=dev COMPOSER_FLAGS="--prefer-stable" before_install: - composer self-update From 576359a4cc2bb6c45dcf705102716c2ec7b3c83e Mon Sep 17 00:00:00 2001 From: stephanvierkant Date: Wed, 28 Aug 2019 16:41:04 +0200 Subject: [PATCH 15/15] composer.json updated --- composer.json | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 24d81b46..f3acd27e 100644 --- a/composer.json +++ b/composer.json @@ -20,20 +20,17 @@ "require": { "php": ">=7.1", "doctrine/orm": "^2.5", + "friendsofsymfony/jsrouting-bundle": "^1.6|^2.0", + "symfony/framework-bundle": "^3.4|^4.1", "symfony/options-resolver": "^3.4|^4.1", "symfony/property-access": "^3.4|^4.1", "symfony/security": "^3.4|^4.1", "symfony/translation": "^3.4|^4.1", - "symfony/framework-bundle": "^3.4|^4.1", - "friendsofsymfony/jsrouting-bundle": "^1.6|^2.0", - "symfony/flex": "^1.4" + "twig/twig": "^2.9" }, "require-dev": { "phpunit/phpunit": "5.7.*", - "friendsofphp/php-cs-fixer": "^2.15", - "symfony/security": "^3.4|^4.1", - "symfony/translation": "^3.4|^4.1", - "twig/twig": "^2.9" + "friendsofphp/php-cs-fixer": "^2.15" }, "autoload": { "psr-4": { "Sg\\DatatablesBundle\\": "" }