From 2fa1adbbd8c8246f2e500b0cd1c4b75415f58915 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 24 Jun 2020 16:15:27 +0200 Subject: [PATCH 1/9] Bumps minimal Symfony version to 4.4 --- composer.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 20048dd..3c0e6aa 100644 --- a/composer.json +++ b/composer.json @@ -15,22 +15,22 @@ "email": "info@freshheads.com", "issues": "https://github.com/freshheads/FHWebpackBundle/issues" }, - "require-dev": { - "phpunit/phpunit": "^8.4" - }, "require": { "php": "^7.2", - "symfony/asset": "^3.4 || ^4.0 || ^5.0", - "symfony/config": "^3.4 || ^4.0 || ^5.0", - "symfony/dependency-injection": "^3.4 || ^4.0 || ^5.0", - "symfony/event-dispatcher": "^3.4 || ^4.0 || ^5.0", - "symfony/http-kernel": "^3.4 || ^4.0 || ^5.0", - "symfony/yaml": "^3.4 || ^4.0 || ^5.0", - "symfony/twig-bundle": "^3.4 || ^4.0 || ^5.0", - "symfony/templating": "^3.4 || ^4.0 || ^5.0", - "twig/twig" : "^2.0 || ^3.0", + "symfony/asset": "^4.4 | ^5.0", + "symfony/config": "^4.4 | ^5.0", + "symfony/dependency-injection": "^4.4 | ^5.0", + "symfony/event-dispatcher": "^4.4 | ^5.0", + "symfony/http-kernel": "^4.4 | ^5.0", + "symfony/yaml": "^4.4 | ^5.0", + "symfony/twig-bundle": "^4.4 | ^5.0", + "symfony/templating": "^4.4 | ^5.0", + "twig/twig" : "^2.0 | ^3.0", "freshheads/webpack-stats": "^1.1" }, + "require-dev": { + "phpunit/phpunit": "^8.4 | ^9.0" + }, "scripts": { "test": "vendor/bin/phpunit --color=always" }, From e7cc9f3c9d045370e089b2ac0ed40b1928b964ee Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 24 Jun 2020 16:23:02 +0200 Subject: [PATCH 2/9] Runs tests against symfony's phpunit bridge --- .travis.yml | 4 ++-- composer.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3b3b4ce..941ee2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ cache: env: global: - - PHPUNIT_FLAGS="-v -c ." + - PHPUNIT_FLAGS="--colors=always --testdox -v -c ." - SYMFONY_DEPRECATIONS_HELPER="max[self]=0" matrix: @@ -40,7 +40,7 @@ install: script: - composer validate --strict --no-check-lock - - ./vendor/bin/phpunit $PHPUNIT_FLAGS + - ./vendor/bin/simple-phpunit $PHPUNIT_FLAGS notifications: email: travis-ci@freshheads.com diff --git a/composer.json b/composer.json index 3c0e6aa..a2496c4 100644 --- a/composer.json +++ b/composer.json @@ -29,10 +29,10 @@ "freshheads/webpack-stats": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^8.4 | ^9.0" + "symfony/phpunit-bridge": "^4.4 | ^5.0" }, "scripts": { - "test": "vendor/bin/phpunit --color=always" + "test": "vendor/bin/simple-phpunit --color=always --testdox" }, "autoload": { "psr-4": { "FH\\Bundle\\WebpackBundle\\": "" } From d6a2232533ef0fb1ebe695f7fac447c41f388f10 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 24 Jun 2020 16:24:15 +0200 Subject: [PATCH 3/9] Drops bundle config bc layer for Symfony version 4.1 and lower --- DependencyInjection/Configuration.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 41efb89..3c0a19b 100755 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -15,25 +15,15 @@ use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; -use function method_exists; - /** * @author Joris van de Sande */ class Configuration implements ConfigurationInterface { - private const ROOT_NAME = 'fh_webpack'; - public function getConfigTreeBuilder(): TreeBuilder { - $treeBuilder = new TreeBuilder(self::ROOT_NAME); - - if (method_exists($treeBuilder, 'getRootNode')) { - $rootNode = $treeBuilder->getRootNode(); - } else { - // BC layer for symfony/config 4.1 and older - $rootNode = $treeBuilder->root(self::ROOT_NAME); - } + $treeBuilder = new TreeBuilder('fh_webpack'); + $rootNode = $treeBuilder->getRootNode(); $rootNode ->children() From ca13e9900ad867b4f8d766b88163ec2303bfdc06 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 24 Jun 2020 16:26:49 +0200 Subject: [PATCH 4/9] Makes bundle config classes final --- DependencyInjection/Configuration.php | 2 +- DependencyInjection/FHWebpackExtension.php | 2 +- FHWebpackBundle.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 3c0a19b..cdbcb5f 100755 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -18,7 +18,7 @@ /** * @author Joris van de Sande */ -class Configuration implements ConfigurationInterface +final class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder(): TreeBuilder { diff --git a/DependencyInjection/FHWebpackExtension.php b/DependencyInjection/FHWebpackExtension.php index fca6d64..fd91cdd 100755 --- a/DependencyInjection/FHWebpackExtension.php +++ b/DependencyInjection/FHWebpackExtension.php @@ -20,7 +20,7 @@ /** * @author Joris van de Sande */ -class FHWebpackExtension extends Extension +final class FHWebpackExtension extends Extension { public function load(array $configs, ContainerBuilder $container): void { diff --git a/FHWebpackBundle.php b/FHWebpackBundle.php index b056e92..f85b9cc 100755 --- a/FHWebpackBundle.php +++ b/FHWebpackBundle.php @@ -16,6 +16,6 @@ /** * @author Joris van de Sande */ -class FHWebpackBundle extends Bundle +final class FHWebpackBundle extends Bundle { } From 9a5713af46c84a4c8e9179ace9060acb06d51ecd Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 24 Jun 2020 16:27:00 +0200 Subject: [PATCH 5/9] Updates changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97613e9..4c617ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ CHANGELOG This changelog references the relevant changes (bug and security fixes). +1.4.0 +--- + +* Drops support for Symfony versions below 4.4 +* Allows php version 7.2 and higher +* Runs tests against Symfony's phpunit bridge +* Makes bundle config classes final + 1.3.0 ----- From 9ae30c2d8613d45e10acf333168a8424d5ce3ba9 Mon Sep 17 00:00:00 2001 From: Kevin Date: Tue, 30 Jun 2020 11:26:49 +0200 Subject: [PATCH 6/9] Updates test classes namespace to match psr-4 standards --- Tests/DependencyInjection/ConfigurationTest.php | 2 +- Tests/Templating/WebpackHelperTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/Tests/DependencyInjection/ConfigurationTest.php index 88ff8cb..52f2159 100644 --- a/Tests/DependencyInjection/ConfigurationTest.php +++ b/Tests/DependencyInjection/ConfigurationTest.php @@ -10,7 +10,7 @@ * file that was distributed with this source code. */ -namespace Tests\DependencyInjection; +namespace FH\Bundle\WebpackBundle\Tests\DependencyInjection; use FH\Bundle\WebpackBundle\DependencyInjection\Configuration; use PHPUnit\Framework\TestCase; diff --git a/Tests/Templating/WebpackHelperTest.php b/Tests/Templating/WebpackHelperTest.php index 51df317..ea7f43b 100644 --- a/Tests/Templating/WebpackHelperTest.php +++ b/Tests/Templating/WebpackHelperTest.php @@ -10,7 +10,7 @@ * file that was distributed with this source code. */ -namespace Tests\Templating; +namespace FH\Bundle\WebpackBundle\Tests\Templating; use FH\Bundle\WebpackBundle\Templating\WebpackHelper; use FH\WebpackStats\Parser\StandardParser; From f3d29cda4b605600b5d8f1841d82b15adc6315d6 Mon Sep 17 00:00:00 2001 From: Kevin Date: Tue, 30 Jun 2020 11:32:58 +0200 Subject: [PATCH 7/9] Triggers deprecation warning on twig extension service aliases --- Resources/config/services.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Resources/config/services.yml b/Resources/config/services.yml index a18a86e..66c3c2f 100755 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -20,15 +20,12 @@ services: # aliases to keep up BC fh_webpack.twig_extension: alias: FH\Bundle\WebpackBundle\Twig\WebpackExtension - # next line can be enabled when Symfony 4.3 becomes the minimal supported version - #deprecated: 'The "%alias_id%" service alias is deprecated, make use of autowiring or FQN.' + deprecated: 'The "%alias_id%" service alias is deprecated, make use of autowiring or FQN.' fh_webpack.webpack_helper: alias: FH\Bundle\WebpackBundle\Templating\WebpackHelper - # next line can be enabled when Symfony 4.3 becomes the minimal supported version - #deprecated: 'The "%alias_id%" service alias is deprecated, make use of autowiring or FQN.' + deprecated: 'The "%alias_id%" service alias is deprecated, make use of autowiring or FQN.' fh_webpack.stats_parser: alias: FH\WebpackStats\Parser\StandardParser - # next line can be enabled when Symfony 4.3 becomes the minimal supported version - #deprecated: 'The "%alias_id%" service alias is deprecated, make use of autowiring or FQN.' + deprecated: 'The "%alias_id%" service alias is deprecated, make use of autowiring or FQN.' From b2263ceae465c526eaf1f691d21908e62d7b1294 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 8 Jul 2020 09:28:42 +0200 Subject: [PATCH 8/9] Marks bundle config classes as final in docblocks --- CHANGELOG.md | 2 +- DependencyInjection/Configuration.php | 3 ++- DependencyInjection/FHWebpackExtension.php | 3 ++- FHWebpackBundle.php | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c617ac..267361a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ This changelog references the relevant changes (bug and security fixes). * Drops support for Symfony versions below 4.4 * Allows php version 7.2 and higher * Runs tests against Symfony's phpunit bridge -* Makes bundle config classes final +* Marks bundle config classes as final in docblocks; will be final in next major 1.3.0 ----- diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index cdbcb5f..03469ba 100755 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -17,8 +17,9 @@ /** * @author Joris van de Sande + * @final */ -final class Configuration implements ConfigurationInterface +class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder(): TreeBuilder { diff --git a/DependencyInjection/FHWebpackExtension.php b/DependencyInjection/FHWebpackExtension.php index fd91cdd..bf46c92 100755 --- a/DependencyInjection/FHWebpackExtension.php +++ b/DependencyInjection/FHWebpackExtension.php @@ -19,8 +19,9 @@ /** * @author Joris van de Sande + * @final */ -final class FHWebpackExtension extends Extension +class FHWebpackExtension extends Extension { public function load(array $configs, ContainerBuilder $container): void { diff --git a/FHWebpackBundle.php b/FHWebpackBundle.php index f85b9cc..29c31dd 100755 --- a/FHWebpackBundle.php +++ b/FHWebpackBundle.php @@ -15,7 +15,8 @@ /** * @author Joris van de Sande + * @final */ -final class FHWebpackBundle extends Bundle +class FHWebpackBundle extends Bundle { } From 36fc72d5fd681d5648c41ced62f1f249c47f937a Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 8 Jul 2020 09:28:53 +0200 Subject: [PATCH 9/9] Updates changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 267361a..714f6b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This changelog references the relevant changes (bug and security fixes). * Drops support for Symfony versions below 4.4 * Allows php version 7.2 and higher * Runs tests against Symfony's phpunit bridge +* Updates namespace of test classes to match psr-4 standards * Marks bundle config classes as final in docblocks; will be final in next major 1.3.0