From 0cbf08052c7ceff3b86fd08241972d18ee8a0443 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Thu, 5 May 2022 14:07:47 +0200 Subject: [PATCH 1/5] Declare missing dependencies and setup GHA workflows to check them (#1) This sets up a workflow with [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to make sure all actual dependencies are declared. --- .github/workflows/dependencies.yml | 35 +++++++++++++++++++ .travis.yml | 2 +- composer.json | 19 +++++----- Tests/phpunit.xml.dist => phpunit.xml.dist | 10 ++---- .../DependencyInjection}/Configuration.php | 0 .../JbPhumborExtension.php | 0 .../JbPhumborBundle.php | 0 .../Resources}/config/services.yml | 0 {Resources => src/Resources}/doc/reference.md | 0 {Resources => src/Resources}/doc/service.md | 0 .../Resources}/doc/twig_helper.md | 0 .../Transformer}/BaseTransformer.php | 0 .../Exception/PhumborException.php | 0 .../UnknownTransformationException.php | 0 {Twig => src/Twig}/PhumborExtension.php | 0 .../DependencyInjection/ConfigurationTest.php | 0 .../Fixtures/yml/transformers.yml | 0 .../JbPhumborExtensionTest.php | 0 .../YamlJbPhumborExtensionTest.php | 0 .../Transformer/BaseTransformerTest.php | 0 .../Twig/PhumborExtensionTest.php | 0 {Tests => tests}/bootstrap.php | 0 22 files changed, 49 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/dependencies.yml rename Tests/phpunit.xml.dist => phpunit.xml.dist (68%) rename {DependencyInjection => src/DependencyInjection}/Configuration.php (100%) rename {DependencyInjection => src/DependencyInjection}/JbPhumborExtension.php (100%) rename JbPhumborBundle.php => src/JbPhumborBundle.php (100%) rename {Resources => src/Resources}/config/services.yml (100%) rename {Resources => src/Resources}/doc/reference.md (100%) rename {Resources => src/Resources}/doc/service.md (100%) rename {Resources => src/Resources}/doc/twig_helper.md (100%) rename {Transformer => src/Transformer}/BaseTransformer.php (100%) rename {Transformer => src/Transformer}/Exception/PhumborException.php (100%) rename {Transformer => src/Transformer}/Exception/UnknownTransformationException.php (100%) rename {Twig => src/Twig}/PhumborExtension.php (100%) rename {Tests => tests}/DependencyInjection/ConfigurationTest.php (100%) rename {Tests => tests}/DependencyInjection/Fixtures/yml/transformers.yml (100%) rename {Tests => tests}/DependencyInjection/JbPhumborExtensionTest.php (100%) rename {Tests => tests}/DependencyInjection/YamlJbPhumborExtensionTest.php (100%) rename {Tests => tests}/Transformer/BaseTransformerTest.php (100%) rename {Tests => tests}/Twig/PhumborExtensionTest.php (100%) rename {Tests => tests}/bootstrap.php (100%) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml new file mode 100644 index 0000000..eca630a --- /dev/null +++ b/.github/workflows/dependencies.yml @@ -0,0 +1,35 @@ +name: Dependencies + +permissions: + contents: read + +on: + push: + branches: + - master + pull_request: + +env: + PHP_VERSION: 7.4 + +jobs: + composer-require-checker: + name: Check missing composer requirements + runs-on: ubuntu-latest + steps: + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ env.PHP_VERSION }} + tools: composer:v2 + - uses: actions/checkout@v3 + - uses: actions/cache@v2 + with: + path: vendor + key: composer-${{ runner.os }}-${{ env.PHP_VERSION }}-${{ hashFiles('composer.json') }} + restore-keys: | + composer-${{ runner.os }}-${{ env.PHP_VERSION }}- + composer-${{ runner.os }}- + - run: | + composer install --no-interaction --no-progress --ansi --no-scripts + composer show + - uses: docker://webfactory/composer-require-checker:3.2.0 diff --git a/.travis.yml b/.travis.yml index 4a50b38..92d9dd5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,6 @@ before_script: - wget https://scrutinizer-ci.com/ocular.phar script: - - vendor/bin/phpunit -c Tests/ --coverage-clover=coverage.clover + - vendor/bin/phpunit -c tests/ --coverage-clover=coverage.clover - phpcs --standard=PSR2 --extensions=php --ignore=vendor . - php ocular.phar code-coverage:upload --format=php-clover coverage.clover diff --git a/composer.json b/composer.json index de162a9..99f1e4b 100644 --- a/composer.json +++ b/composer.json @@ -1,25 +1,26 @@ { "name": "jbouzekri/phumbor-bundle", "type": "symfony-bundle", - "description": "A bridge for symfony with the phumbor client from 99designs", + "description": "A Symfony Bundle to use the minimal Thumbor PHP client from webfactory/phumbor", "keywords": ["phumbor", "thumbor", "Bundle", "Helper", "Twig", "Symfony"], "homepage": "https://github.com/jbouzekri/PhumborBundle", "license": "MIT", "require": { + "php": "^7.2|8.0.*|8.1.*", + "symfony/config": "^3.4|^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^3.4|^4.4|^5.0|^6.0", + "symfony/http-kernel": "^3.4|^4.4|^5.0|^6.0", + "twig/twig": "^1.34|^2.0|^3.0", "webfactory/phumbor": "^1.1" }, "require-dev": { - "symfony/config": "^3.4", - "symfony/dependency-injection": "^3.4", - "symfony/http-kernel": "^3.4", - "symfony/yaml": "^3.4", "phpunit/phpunit": "^7.0", "twig/extensions": "~1.0" }, - "conflict": { - "twig/twig": "<1.34" - }, "autoload": { - "psr-4": { "Jb\\Bundle\\PhumborBundle\\": "" } + "psr-4": { "Jb\\Bundle\\PhumborBundle\\": "src" } + }, + "autoload-dev": { + "psr-4": { "Jb\\Bundle\\PhumborBundle\\Tests\\": "tests" } } } diff --git a/Tests/phpunit.xml.dist b/phpunit.xml.dist similarity index 68% rename from Tests/phpunit.xml.dist rename to phpunit.xml.dist index a835375..b9d7927 100644 --- a/Tests/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -7,21 +7,17 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - bootstrap="bootstrap.php" + bootstrap="tests/bootstrap.php" > - . + tests - . - - vendor - Tests - + src diff --git a/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php similarity index 100% rename from DependencyInjection/Configuration.php rename to src/DependencyInjection/Configuration.php diff --git a/DependencyInjection/JbPhumborExtension.php b/src/DependencyInjection/JbPhumborExtension.php similarity index 100% rename from DependencyInjection/JbPhumborExtension.php rename to src/DependencyInjection/JbPhumborExtension.php diff --git a/JbPhumborBundle.php b/src/JbPhumborBundle.php similarity index 100% rename from JbPhumborBundle.php rename to src/JbPhumborBundle.php diff --git a/Resources/config/services.yml b/src/Resources/config/services.yml similarity index 100% rename from Resources/config/services.yml rename to src/Resources/config/services.yml diff --git a/Resources/doc/reference.md b/src/Resources/doc/reference.md similarity index 100% rename from Resources/doc/reference.md rename to src/Resources/doc/reference.md diff --git a/Resources/doc/service.md b/src/Resources/doc/service.md similarity index 100% rename from Resources/doc/service.md rename to src/Resources/doc/service.md diff --git a/Resources/doc/twig_helper.md b/src/Resources/doc/twig_helper.md similarity index 100% rename from Resources/doc/twig_helper.md rename to src/Resources/doc/twig_helper.md diff --git a/Transformer/BaseTransformer.php b/src/Transformer/BaseTransformer.php similarity index 100% rename from Transformer/BaseTransformer.php rename to src/Transformer/BaseTransformer.php diff --git a/Transformer/Exception/PhumborException.php b/src/Transformer/Exception/PhumborException.php similarity index 100% rename from Transformer/Exception/PhumborException.php rename to src/Transformer/Exception/PhumborException.php diff --git a/Transformer/Exception/UnknownTransformationException.php b/src/Transformer/Exception/UnknownTransformationException.php similarity index 100% rename from Transformer/Exception/UnknownTransformationException.php rename to src/Transformer/Exception/UnknownTransformationException.php diff --git a/Twig/PhumborExtension.php b/src/Twig/PhumborExtension.php similarity index 100% rename from Twig/PhumborExtension.php rename to src/Twig/PhumborExtension.php diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/tests/DependencyInjection/ConfigurationTest.php similarity index 100% rename from Tests/DependencyInjection/ConfigurationTest.php rename to tests/DependencyInjection/ConfigurationTest.php diff --git a/Tests/DependencyInjection/Fixtures/yml/transformers.yml b/tests/DependencyInjection/Fixtures/yml/transformers.yml similarity index 100% rename from Tests/DependencyInjection/Fixtures/yml/transformers.yml rename to tests/DependencyInjection/Fixtures/yml/transformers.yml diff --git a/Tests/DependencyInjection/JbPhumborExtensionTest.php b/tests/DependencyInjection/JbPhumborExtensionTest.php similarity index 100% rename from Tests/DependencyInjection/JbPhumborExtensionTest.php rename to tests/DependencyInjection/JbPhumborExtensionTest.php diff --git a/Tests/DependencyInjection/YamlJbPhumborExtensionTest.php b/tests/DependencyInjection/YamlJbPhumborExtensionTest.php similarity index 100% rename from Tests/DependencyInjection/YamlJbPhumborExtensionTest.php rename to tests/DependencyInjection/YamlJbPhumborExtensionTest.php diff --git a/Tests/Transformer/BaseTransformerTest.php b/tests/Transformer/BaseTransformerTest.php similarity index 100% rename from Tests/Transformer/BaseTransformerTest.php rename to tests/Transformer/BaseTransformerTest.php diff --git a/Tests/Twig/PhumborExtensionTest.php b/tests/Twig/PhumborExtensionTest.php similarity index 100% rename from Tests/Twig/PhumborExtensionTest.php rename to tests/Twig/PhumborExtensionTest.php diff --git a/Tests/bootstrap.php b/tests/bootstrap.php similarity index 100% rename from Tests/bootstrap.php rename to tests/bootstrap.php From a387ccec50bc509dc652c8636595db9709857e3d Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Thu, 5 May 2022 14:08:57 +0200 Subject: [PATCH 2/5] Update PHPUnit to v8 or v9, depending on the PHP version used (#2) This updates tests for PHPUnit v8/v9, and sets up a GHA workflow to run a test matrix for PRs. --- .github/workflows/lock-symfony-version.sh | 3 ++ .github/workflows/tests.yml | 41 +++++++++++++++++++ composer.json | 6 ++- phpunit.xml.dist | 6 ++- .../DependencyInjection/ConfigurationTest.php | 7 +++- .../JbPhumborExtensionTest.php | 3 +- .../YamlJbPhumborExtensionTest.php | 1 + tests/Transformer/BaseTransformerTest.php | 10 ++--- tests/Twig/PhumborExtensionTest.php | 5 ++- tests/bootstrap.php | 14 ------- 10 files changed, 68 insertions(+), 28 deletions(-) create mode 100755 .github/workflows/lock-symfony-version.sh create mode 100644 .github/workflows/tests.yml delete mode 100644 tests/bootstrap.php diff --git a/.github/workflows/lock-symfony-version.sh b/.github/workflows/lock-symfony-version.sh new file mode 100755 index 0000000..0bdbe89 --- /dev/null +++ b/.github/workflows/lock-symfony-version.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +cat <<< $(jq --arg version $VERSION '.require |= with_entries(if ((.key|test("^symfony/service-contracts")|not) and (.key|test("^symfony/"))) then .value=$version else . end)' < composer.json) > composer.json diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..6161d7c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,41 @@ +name: Tests + +on: + push: + branches: + - master + pull_request: + +env: + SYMFONY_DEPRECATIONS_HELPER: weak + +jobs: + PHPUnit: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - { php-version: 7.2, symfony-locked-version: none, dependency-version: prefer-lowest } + - { php-version: 7.4, symfony-locked-version: 4.4.*, dependency-version: prefer-stable } + - { php-version: 7.4, symfony-locked-version: none, dependency-version: prefer-stable } + - { php-version: 8.1, symfony-locked-version: none, dependency-version: prefer-stable } + name: PHPUnit (PHP ${{matrix.php-version}}, Symfony Version Lock ${{ matrix.symfony-locked-version }}, ${{ matrix.dependency-version }}) + steps: + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer:v2 + - uses: actions/checkout@v3 + - run: VERSION=${{ matrix.symfony-locked-version }} .github/workflows/lock-symfony-version.sh + if: matrix.symfony-locked-version != 'none' + - uses: actions/cache@v2 + with: + path: vendor + key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.symfony-locked-version }}-${{ matrix.dependency-version }}-${{ hashFiles('composer.json') }} + restore-keys: | + composer-${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.symfony-locked-version }}-${{ matrix.dependency-version }}- + - run: | + composer update --no-interaction --no-progress --ansi --no-scripts --${{ matrix.dependency-version}} + composer show + - run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index 99f1e4b..8188a63 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,10 @@ "webfactory/phumbor": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^7.0", - "twig/extensions": "~1.0" + "phpunit/phpunit": "^8.5.26|^9.5.20", + "symfony/yaml": "^3.4|^4.4|^5.0|^6.0", + "twig/extensions": "~1.0", + "symfony/phpunit-bridge": ">=6.0" }, "autoload": { "psr-4": { "Jb\\Bundle\\PhumborBundle\\": "src" } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b9d7927..e6f12b7 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -7,9 +7,8 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - bootstrap="tests/bootstrap.php" + bootstrap="vendor/autoload.php" > - tests @@ -20,4 +19,7 @@ src + + + diff --git a/tests/DependencyInjection/ConfigurationTest.php b/tests/DependencyInjection/ConfigurationTest.php index 93ca2f3..c9426e9 100644 --- a/tests/DependencyInjection/ConfigurationTest.php +++ b/tests/DependencyInjection/ConfigurationTest.php @@ -3,6 +3,8 @@ namespace Jb\Bundle\PhumborBundle\Tests\DependencyInjection; use Jb\Bundle\PhumborBundle\DependencyInjection\Configuration; +use PHPUnit\Framework\TestCase; +use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; use Symfony\Component\Config\Definition\Processor; /** @@ -10,7 +12,7 @@ * * @author Jonathan Bouzekri */ -class ConfigurationTest extends \PHPUnit_Framework_TestCase +class ConfigurationTest extends TestCase { /** * Test the default configuration @@ -135,11 +137,12 @@ public function getTransformationData() } /** - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException * @dataProvider getInvalidTypeData */ public function testInvalidType($transformationData) { + self::expectException(InvalidConfigurationException::class); + $processor = new Processor(); $configuration = new Configuration(); $processor->processConfiguration($configuration, array( diff --git a/tests/DependencyInjection/JbPhumborExtensionTest.php b/tests/DependencyInjection/JbPhumborExtensionTest.php index 539f611..fe17364 100644 --- a/tests/DependencyInjection/JbPhumborExtensionTest.php +++ b/tests/DependencyInjection/JbPhumborExtensionTest.php @@ -2,6 +2,7 @@ namespace Jb\Bundle\PhumborBundle\Tests\DependencyInjection; +use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; use Jb\Bundle\PhumborBundle\DependencyInjection\JbPhumborExtension; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; @@ -11,7 +12,7 @@ * * @author Jonathan Bouzekri */ -abstract class JbPhumborExtensionTest extends \PHPUnit_Framework_TestCase +abstract class JbPhumborExtensionTest extends TestCase { /** * Defined in children class diff --git a/tests/DependencyInjection/YamlJbPhumborExtensionTest.php b/tests/DependencyInjection/YamlJbPhumborExtensionTest.php index 936f538..612d99a 100644 --- a/tests/DependencyInjection/YamlJbPhumborExtensionTest.php +++ b/tests/DependencyInjection/YamlJbPhumborExtensionTest.php @@ -2,6 +2,7 @@ namespace Jb\Bundle\PhumborBundle\Tests\DependencyInjection; +use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\Config\FileLocator; diff --git a/tests/Transformer/BaseTransformerTest.php b/tests/Transformer/BaseTransformerTest.php index 2d4d26a..843b63c 100644 --- a/tests/Transformer/BaseTransformerTest.php +++ b/tests/Transformer/BaseTransformerTest.php @@ -3,6 +3,8 @@ namespace Jb\Bundle\PhumborBundle\Tests\Transformer; use Jb\Bundle\PhumborBundle\Transformer\BaseTransformer; +use Jb\Bundle\PhumborBundle\Transformer\Exception\UnknownTransformationException; +use PHPUnit\Framework\TestCase; use Thumbor\Url\BuilderFactory; /** @@ -10,7 +12,7 @@ * * @author jobou */ -class BaseTransformerTest extends \PHPUnit_Framework_TestCase +class BaseTransformerTest extends TestCase { /** * @var \Jb\Bundle\PhumborBundle\Transformer\BaseTransformer @@ -25,7 +27,7 @@ class BaseTransformerTest extends \PHPUnit_Framework_TestCase /** * SetUp */ - public function setUp() + public function setUp(): void { $this->factory = new BuilderFactory('http://localhost', '123456789'); $this->transformer = new BaseTransformer( @@ -60,11 +62,9 @@ public function testNormalTransformation() $this->assertEquals($transformedUrl, $buildedUrl); } - /** - * @expectedException \Jb\Bundle\PhumborBundle\Transformer\Exception\UnknownTransformationException - */ public function testUnknownTransformationException() { + self::expectException(UnknownTransformationException::class); $transformedUrl = $this->transformer->transform('http://phumbor.jb.fr/logo.png', 'not_known'); $buildedUrl = $this->factory->url('http://phumbor.jb.fr/logo.png'); diff --git a/tests/Twig/PhumborExtensionTest.php b/tests/Twig/PhumborExtensionTest.php index 8d7ada2..cc2266d 100644 --- a/tests/Twig/PhumborExtensionTest.php +++ b/tests/Twig/PhumborExtensionTest.php @@ -4,6 +4,7 @@ use Jb\Bundle\PhumborBundle\Twig\PhumborExtension; use Jb\Bundle\PhumborBundle\Transformer\BaseTransformer; +use PHPUnit\Framework\TestCase; use Thumbor\Url\BuilderFactory; /** @@ -11,7 +12,7 @@ * * @author jobou */ -class PhumborExtensionTest extends \PHPUnit_Framework_TestCase +class PhumborExtensionTest extends TestCase { /** * @var \Jb\Bundle\PhumborBundle\Twig\PhumborExtension @@ -26,7 +27,7 @@ class PhumborExtensionTest extends \PHPUnit_Framework_TestCase /** * SetUp */ - public function setUp() + public function setUp(): void { $this->factory = new BuilderFactory('http://localhost', '123456789'); $transformer = new BaseTransformer( diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index 6bb9e24..0000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,14 +0,0 @@ - Date: Thu, 5 May 2022 15:09:57 +0200 Subject: [PATCH 3/5] Add return type hints (#3) This adds a few return type hints where Symfony 5.4 triggers deprecation notices. I don't see the risk of BC breaks since there is no good reason to overwrite the methods affected. Adding types should even be compatible with PHP 7.0. --- src/DependencyInjection/Configuration.php | 6 +----- src/DependencyInjection/JbPhumborExtension.php | 4 ++-- src/Transformer/BaseTransformer.php | 8 +------- src/Twig/PhumborExtension.php | 4 ++-- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index d90af43..9326888 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -16,10 +16,8 @@ class Configuration implements ConfigurationInterface { /** * Generates the configuration tree builder. - * - * @return TreeBuilder The tree builder */ - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { if (Kernel::VERSION_ID >= 40200) { $treeBuilder = new TreeBuilder('jb_phumbor'); @@ -51,8 +49,6 @@ public function getConfigTreeBuilder() /** * Add the transformation section configuration structure - * - * @param \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $rootNode */ private function addTransformationSection(ArrayNodeDefinition $rootNode) { diff --git a/src/DependencyInjection/JbPhumborExtension.php b/src/DependencyInjection/JbPhumborExtension.php index 8ed4f54..5eedb2b 100644 --- a/src/DependencyInjection/JbPhumborExtension.php +++ b/src/DependencyInjection/JbPhumborExtension.php @@ -17,7 +17,7 @@ class JbPhumborExtension extends Extension /** * {@inheritDoc} */ - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $config = $this->processConfiguration(new Configuration(), $configs); $this->loadConfiguration($container, $config); @@ -32,7 +32,7 @@ public function load(array $configs, ContainerBuilder $container) * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container * @param array $config */ - protected function loadConfiguration(ContainerBuilder $container, array $config) + protected function loadConfiguration(ContainerBuilder $container, array $config): void { $container->setParameter('env(THUMBOR_URL)', 'http://localhost:8888'); $container->setParameter('env(THUMBOR_SECURITY_KEY)', ''); diff --git a/src/Transformer/BaseTransformer.php b/src/Transformer/BaseTransformer.php index 74909a8..67e170f 100644 --- a/src/Transformer/BaseTransformer.php +++ b/src/Transformer/BaseTransformer.php @@ -33,7 +33,7 @@ class BaseTransformer /** * Phumbor Builder Factory * - * @var \Thumbor\Url\BuilderFactory + * @var BuilderFactory */ protected $factory; @@ -44,12 +44,6 @@ class BaseTransformer */ protected $transformations; - /** - * Constructor - * - * @param \Thumbor\Url\BuilderFactory $factory - * @param array $transformations - */ public function __construct(BuilderFactory $factory, array $transformations) { $this->factory = $factory; diff --git a/src/Twig/PhumborExtension.php b/src/Twig/PhumborExtension.php index 7c31780..a0a4af0 100644 --- a/src/Twig/PhumborExtension.php +++ b/src/Twig/PhumborExtension.php @@ -32,7 +32,7 @@ public function __construct(BaseTransformer $transformer) /** * {@inheritDoc} */ - public function getFilters() + public function getFilters(): array { return array( new TwigFilter('thumbor', array($this, 'transform')), @@ -42,7 +42,7 @@ public function getFilters() /** * {@inheritDoc} */ - public function getFunctions() + public function getFunctions(): array { return array( new TwigFunction('thumbor', array($this, 'transform')), From faa6d2782f786799b8f71b767495c30acd0637e1 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Thu, 5 May 2022 21:37:38 +0200 Subject: [PATCH 4/5] Run tests against Symfony 5.4 LTS as well --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6161d7c..2c6f744 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: include: - { php-version: 7.2, symfony-locked-version: none, dependency-version: prefer-lowest } - { php-version: 7.4, symfony-locked-version: 4.4.*, dependency-version: prefer-stable } - - { php-version: 7.4, symfony-locked-version: none, dependency-version: prefer-stable } + - { php-version: 8.1, symfony-locked-version: 5.4.*, dependency-version: prefer-stable } - { php-version: 8.1, symfony-locked-version: none, dependency-version: prefer-stable } name: PHPUnit (PHP ${{matrix.php-version}}, Symfony Version Lock ${{ matrix.symfony-locked-version }}, ${{ matrix.dependency-version }}) steps: From fa171c976780393b83db36502c4a8260c85af66d Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Thu, 5 May 2022 21:40:39 +0200 Subject: [PATCH 5/5] Try fixing Travis builds by running the same command as in GHA --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 92d9dd5..346b139 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,6 @@ before_script: - wget https://scrutinizer-ci.com/ocular.phar script: - - vendor/bin/phpunit -c tests/ --coverage-clover=coverage.clover + - vendor/bin/phpunit --coverage-clover=coverage.clover - phpcs --standard=PSR2 --extensions=php --ignore=vendor . - php ocular.phar code-coverage:upload --format=php-clover coverage.clover