Skip to content

Commit

Permalink
Merge pull request #7 from PUGX/sf7
Browse files Browse the repository at this point in the history
⬆️  upgrade deps
  • Loading branch information
garak authored Dec 10, 2023
2 parents bee0d7b + 28d676f commit 3d3c8e4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 25 deletions.
33 changes: 21 additions & 12 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: PHPStan
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: PHPStan
uses: docker://oskarstark/phpstan-ga
env:
Expand All @@ -22,7 +22,7 @@ jobs:
name: PHP-CS-Fixer
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Fix CS
uses: docker://oskarstark/php-cs-fixer-ga
tests:
Expand All @@ -31,14 +31,15 @@ jobs:
matrix:
include:
- description: 'Lowest'
php: '8.0'
composer_option: '--prefer-lowest'
- description: 'Symfony 5.4'
php: '8.1'
symfony: 5.4.*
- description: 'Symfony 6.2'
symfony: 6.4.*@dev
composer_option: '--prefer-lowest'
- description: 'Symfony 6.4'
php: '8.2'
symfony: 6.2.*
symfony: 6.4.*@dev
- description: 'Symfony 7.0'
php: '8.3'
symfony: 7.0.*@dev
name: PHP ${{ matrix.php }} tests (${{ matrix.description }})
steps:
- name: Checkout
Expand All @@ -52,9 +53,17 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- run: |
sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' composer.json;
- name: Require specific Symfony version
if: matrix.symfony
- run: composer update --no-interaction --no-progress --ansi ${{ matrix.composer_option }}
- run: vendor/bin/phpunit
run: |
sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' composer.json;
- name: Use possible dev deps
if: contains(matrix.symfony, '@dev')
run: |
composer config minimum-stability dev
composer config prefer-stable true
- name: Update vendors
run: composer update --no-interaction --no-progress --ansi ${{ matrix.composer_option }}
- name: Run tests
run: vendor/bin/phpunit

3 changes: 1 addition & 2 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP80Migration:risky' => true,
'@PHP81Migration' => true,
'@PHPUnit84Migration:risky' => true,
'ordered_imports' => true,
'declare_strict_types' => false,
'native_function_invocation' => ['include' => ['@all']],
'php_unit_mock_short_will_return' => true,
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
}
],
"require": {
"php": "^8.0",
"symfony/config": "^5.4 || ^6.0",
"symfony/dependency-injection": "^5.4 || ^6.0",
"symfony/form": "^5.4 || ^6.0",
"symfony/http-kernel": "^5.4 || ^6.0",
"twig/twig": "^3.0"
"php": "^8.1",
"symfony/config": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/form": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"twig/twig": "^3.8"
},
"require-dev": {
"dg/bypass-finals": "^1.3",
"dg/bypass-finals": "^1.5",
"phpunit/phpunit": "^9.6"
},
"config": {
Expand Down
3 changes: 1 addition & 2 deletions src/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
final class Filter
{
/** @var array<int|string, FormInterface> */
private array $forms;
private array $forms = [];

public function __construct(private FormFactoryInterface $formFactory, private RequestStack $requestStack)
{
$this->forms = [];
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/DependencyInjection/FilterExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testPrependWithoutTwig(): void
/** @var ContainerBuilder&\PHPUnit\Framework\MockObject\MockObject $container */
$container = $this->getMockBuilder(ContainerBuilder::class)->disableOriginalConstructor()->getMock();
$container->expects(self::once())->method('hasExtension')->willReturn(false);
$container->expects(self::never())->method('prependExtensionConfig')->willReturn(true);
$container->expects(self::never())->method('prependExtensionConfig');
$extension = new FilterExtension();
$extension->prepend($container);
}
Expand All @@ -32,7 +32,7 @@ public function testPrependWithTwig(): void
/** @var ContainerBuilder&\PHPUnit\Framework\MockObject\MockObject $container */
$container = $this->getMockBuilder(ContainerBuilder::class)->disableOriginalConstructor()->getMock();
$container->expects(self::once())->method('hasExtension')->willReturn(true);
$container->expects(self::once())->method('prependExtensionConfig')->willReturn(true);
$container->expects(self::once())->method('prependExtensionConfig');
$extension = new FilterExtension();
$extension->prepend($container);
}
Expand Down

0 comments on commit 3d3c8e4

Please sign in to comment.