From 92a20825cdb1c9cdcf0ebfb2a63078eab4f76e16 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Fri, 5 Apr 2024 10:21:43 +0200 Subject: [PATCH] Add new ContainerAwareInterface --- .github/workflows/test-application.yaml | 29 ++++++++++++++++--------- CHANGELOG.md | 7 ++++++ Command/BuildCommand.php | 7 ++++-- ContainerAwareInterface.php | 17 +++++++++++++++ 4 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 ContainerAwareInterface.php diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index 8521ab2..85a1fbf 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -19,33 +19,27 @@ jobs: - php-version: '7.2' dependency-versions: 'lowest' tools: 'composer:v1' - php-cs-fixer: false - php-version: '7.4' dependency-versions: 'highest' tools: 'composer:v2' - php-cs-fixer: false - php-version: '8.0' dependency-versions: 'highest' tools: 'composer:v2' - php-cs-fixer: false - php-version: '8.1' dependency-versions: 'highest' tools: 'composer:v2' - php-cs-fixer: true - php-version: '8.2' dependency-versions: 'highest' tools: 'composer:v2' - php-cs-fixer: false - php-version: '8.3' dependency-versions: 'highest' minimum-stability: 'dev' tools: 'composer:v2' - php-cs-fixer: false steps: - name: Checkout project @@ -66,8 +60,26 @@ jobs: with: dependency-versions: ${{matrix.dependency-versions}} + - name: Execute test cases + run: vendor/bin/simple-phpunit + + lint: + steps: + - name: Checkout project + uses: actions/checkout@v2 + + - name: Install and configure PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + tools: 'composer:v2' + + - name: Install composer dependencies + uses: ramsey/composer-install@v1 + with: + dependency-versions: 'highest' + - name: Run php-cs-fixer - if: ${{ matrix.php-cs-fixer }} run: | composer global require friendsofphp/php-cs-fixer --prefer-dist --no-interaction GLOBAL_BIN_DIR=$(composer global config bin-dir --absolute --quiet) @@ -75,6 +87,3 @@ jobs: - name: Lint code run: composer validate --strict - - - name: Execute test cases - run: vendor/bin/simple-phpunit diff --git a/CHANGELOG.md b/CHANGELOG.md index bea168c..310d9c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog for MassiveBuildBundle ================================ +* [0.6.0 (2023-04-05)](https://github.com/massiveart/MassiveBuildBundle/releases/tag/0.6.0) + * Introduce own `ContainerAwareInterface` to keep compatibility with Symfony 7. + +* [0.5.5 (2023-03-15)](https://github.com/massiveart/MassiveBuildBundle/releases/tag/0.5.5) + +* [0.5.4 (2022-04-21)](https://github.com/massiveart/MassiveBuildBundle/releases/tag/0.5.4) + * 0.5.3 (2020-11-11) * ENHANCEMENT #20 Fix autoloader for composer 2 diff --git a/Command/BuildCommand.php b/Command/BuildCommand.php index 44a695b..f0e83ac 100644 --- a/Command/BuildCommand.php +++ b/Command/BuildCommand.php @@ -15,6 +15,7 @@ use Massive\Bundle\BuildBundle\Build\BuilderInterface; use Massive\Bundle\BuildBundle\Build\BuildRegistry; use Massive\Bundle\BuildBundle\Console\MassiveOutputFormatter; +use Massive\Bundle\BuildBundle\ContainerAwareInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Helper\Table; @@ -23,7 +24,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareInterface as SymfonyContainerAwareInterface use Symfony\Component\DependencyInjection\ContainerInterface; class BuildCommand extends Command @@ -178,7 +179,9 @@ protected function runBuilders($builders) foreach ($builders as $builder) { $this->output->getFormatter()->setIndentLevel(0); - if ($builder instanceof ContainerAwareInterface) { + if ($builder instanceof SymfonyContainerAwareInterface + && $builder instanceof ContainerAwareInterface + ) { $builder->setContainer($this->container); } diff --git a/ContainerAwareInterface.php b/ContainerAwareInterface.php new file mode 100644 index 0000000..45a680b --- /dev/null +++ b/ContainerAwareInterface.php @@ -0,0 +1,17 @@ +