Skip to content

Commit 698f587

Browse files
committed
feat: update to sf8
1 parent 2f954ec commit 698f587

11 files changed

Lines changed: 50 additions & 78 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Analyze
1212
runs-on: ubuntu-latest
1313
container:
14-
image: php:8.3-alpine
14+
image: php:8.5-alpine
1515
options: >-
1616
--tmpfs /tmp:exec
1717
--tmpfs /var/tmp:exec
@@ -27,13 +27,13 @@ jobs:
2727
- uses: actions/cache@v3
2828
with:
2929
path: ${{ steps.composer-cache.outputs.dir }}
30-
key: ${{ runner.os }}-composer-8.3-highest-${{ hashFiles('**/composer.json') }}
30+
key: ${{ runner.os }}-composer-8.5-highest-${{ hashFiles('**/composer.json') }}
3131
restore-keys: |
32-
${{ runner.os }}-composer-8.3-highest
32+
${{ runner.os }}-composer-8.5-highest
3333
- name: Validate Composer
3434
run: composer validate
3535
- name: Install highest dependencies with Composer
36-
run: composer update --no-progress --no-suggest --ansi
36+
run: composer update --no-progress --ansi
3737
- name: Disable PHP memory limit
3838
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
3939
- name: Run CS-Fixer
@@ -50,19 +50,10 @@ jobs:
5050
strategy:
5151
matrix:
5252
php:
53-
- '8.1'
54-
- '8.2'
55-
- '8.3'
53+
- '8.5'
5654
dependencies:
5755
- 'lowest'
5856
- 'highest'
59-
include:
60-
- php: '8.1'
61-
phpunit-version: 10
62-
- php: '8.2'
63-
phpunit-version: 10
64-
- php: '8.3'
65-
phpunit-version: 10
6657
fail-fast: false
6758
steps:
6859
- name: Checkout
@@ -81,13 +72,11 @@ jobs:
8172
${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.dependencies }}
8273
- name: Install lowest dependencies with Composer
8374
if: matrix.dependencies == 'lowest'
84-
run: composer update --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi
75+
run: composer update --no-progress --prefer-stable --prefer-lowest --ansi
8576
- name: Install highest dependencies with Composer
8677
if: matrix.dependencies == 'highest'
87-
run: composer update --no-progress --no-suggest --ansi
78+
run: composer update --no-progress --ansi
8879
- name: Run tests with PHPUnit
89-
env:
90-
SYMFONY_MAX_PHPUNIT_VERSION: ${{ matrix.phpunit-version }}
9180
run: vendor/bin/simple-phpunit --colors=always
9281

9382
# coverage:

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
->setRiskyAllowed(true)
1919
->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers())
2020
->setRules([
21-
'@PHP82Migration' => true,
21+
'@PHP85Migration' => true,
2222
'@PhpCsFixer' => true,
2323
'@PhpCsFixer:risky' => true,
2424

composer.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.1",
20-
"doctrine/persistence": "^2.0|^3.0|^4.0",
21-
"symfony/config": "^5.4.30|^6.3|^7.0",
22-
"symfony/dependency-injection": "^5.4.30|^6.3|^7.0",
23-
"symfony/doctrine-bridge": "^5.4.30|^6.3|^7.0",
24-
"symfony/form": "^5.4.30|^6.3|^7.0",
25-
"symfony/http-kernel": "^5.4.30|^6.3|^7.0"
19+
"php": "^8.5",
20+
"doctrine/persistence": "^3.0|^4.0",
21+
"symfony/config": "^8.0",
22+
"symfony/dependency-injection": "^8.0",
23+
"symfony/doctrine-bridge": "^8.0",
24+
"symfony/form": "^8.0",
25+
"symfony/http-kernel": "^8.0"
2626
},
2727
"require-dev": {
28-
"doctrine/orm": "^2.15|^3.0",
29-
"friendsofphp/php-cs-fixer": "^3.45",
28+
"doctrine/orm": "^3.0",
29+
"friendsofphp/php-cs-fixer": "^3.66",
3030
"kubawerlos/php-cs-fixer-custom-fixers": "^3.18",
31-
"phpstan/phpstan": "^1.10",
32-
"rector/rector": "^0.18",
33-
"symfony/cache": "^5.4.30|^6.3|^7.0",
34-
"symfony/phpunit-bridge": "^5.4.30|^6.3|^7.0",
35-
"symfony/validator": "^5.4.30|^6.3|^7.0",
36-
"vimeo/psalm": "^5.18"
31+
"phpstan/phpstan": "^2.1",
32+
"rector/rector": "^2.0",
33+
"symfony/cache": "^8.0",
34+
"symfony/phpunit-bridge": "^8.0",
35+
"symfony/validator": "^8.0",
36+
"vimeo/psalm": "^6.0"
3737
},
3838
"suggest": {
3939
"a2lix/translation-form-bundle": "For translation form"

phpunit.xml.dist

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
3+
<!-- https://docs.phpunit.de/en/11.5/configuration.html -->
44
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
66
backupGlobals="false"
77
colors="true"
88
bootstrap="vendor/autoload.php"
99
>
10-
<coverage>
10+
<source>
1111
<include>
1212
<directory>src/</directory>
1313
</include>
1414
<exclude>
1515
<directory>src/Resources</directory>
1616
</exclude>
17-
</coverage>
17+
</source>
1818

1919
<php>
2020
<ini name="error_reporting" value="-1"/>
21-
<server name="SYMFONY_MAX_PHPUNIT_VERSION" value="9.6" />
21+
<server name="SYMFONY_PHPUNIT_VERSION" value="11.5"/>
2222
</php>
2323

24-
<listeners>
25-
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
26-
</listeners>
24+
<extensions>
25+
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension"/>
26+
</extensions>
2727

2828
<testsuites>
2929
<testsuite name="Bundle Test Suite">

rector.php

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,16 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6-
use Rector\Core\ValueObject\PhpVersion;
7-
use Rector\Doctrine\Set\DoctrineSetList;
8-
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
9-
use Rector\PHPUnit\Set\PHPUnitSetList;
10-
use Rector\Set\ValueObject\LevelSetList;
11-
use Rector\Symfony\Set\SymfonyLevelSetList;
12-
use Rector\Symfony\Set\SymfonySetList;
13-
use Rector\Symfony\Set\TwigSetList;
146

15-
return static function (RectorConfig $rectorConfig): void {
16-
$rectorConfig->parallel();
17-
$rectorConfig->paths([
7+
return RectorConfig::configure()
8+
->withPaths([
189
__DIR__.'/src',
1910
__DIR__.'/tests',
20-
]);
21-
$rectorConfig->importNames();
22-
$rectorConfig->importShortClasses(false);
23-
24-
$rectorConfig->phpVersion(PhpVersion::PHP_82);
25-
$rectorConfig->sets([
26-
LevelSetList::UP_TO_PHP_82,
27-
28-
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
29-
// DoctrineSetList::DOCTRINE_CODE_QUALITY,
30-
DoctrineSetList::DOCTRINE_ORM_214,
31-
DoctrineSetList::DOCTRINE_DBAL_30,
32-
33-
PHPUnitLevelSetList::UP_TO_PHPUNIT_91,
34-
// PHPUnitSetList::PHPUNIT_CODE_QUALITY,
35-
// PHPUnitSetList::PHPUNIT_YIELD_DATA_PROVIDER,
36-
]);
37-
};
11+
])
12+
->withImportNames(importShortClasses: false)
13+
->withPhpSets()
14+
->withComposerBased(
15+
symfony: true,
16+
doctrine: true,
17+
phpunit: true,
18+
);

src/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Configuration implements ConfigurationInterface
2121
public function getConfigTreeBuilder(): TreeBuilder
2222
{
2323
$treeBuilder = new TreeBuilder('a2lix_auto_form');
24-
$rootNode = method_exists(TreeBuilder::class, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->root('a2lix_auto_form');
24+
$rootNode = $treeBuilder->getRootNode();
2525

2626
$rootNode
2727
->children()

src/Form/Manipulator/DoctrineORMManipulator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,6 @@ private function checkFieldIsValid($formFieldName, $formFieldConfig, $validObjec
112112
return;
113113
}
114114

115-
throw new \RuntimeException(sprintf("Field '%s' doesn't exist in %s", $formFieldName, $class));
115+
throw new \RuntimeException(\sprintf("Field '%s' doesn't exist in %s", $formFieldName, $class));
116116
}
117117
}

src/ObjectInfo/DoctrineORMInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function getAssociationTargetClass(string $class, string $fieldName): str
4646
$metadata = $this->classMetadataFactory->getMetadataFor($class);
4747

4848
if (!$metadata->hasAssociation($fieldName)) {
49-
throw new \RuntimeException(sprintf('Unable to find the association target class of "%s" in %s.', $fieldName, $class));
49+
throw new \RuntimeException(\sprintf('Unable to find the association target class of "%s" in %s.', $fieldName, $class));
5050
}
5151

5252
return $metadata->getAssociationTargetClass($fieldName);

tests/Form/Type/AutoFormTypeAdvancedTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public function testCreationFormWithOverriddenFieldsMappedFalse(): Product
139139
return $product;
140140
}
141141

142+
#[\Override]
142143
protected function getExtensions(): array
143144
{
144145
$autoFormType = $this->getConfiguredAutoFormType();

tests/Form/Type/AutoFormTypeSimpleTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use A2lix\AutoFormBundle\Tests\Fixtures\Entity\Media;
1818
use A2lix\AutoFormBundle\Tests\Fixtures\Entity\Product;
1919
use A2lix\AutoFormBundle\Tests\Form\TypeTestCase;
20+
use PHPUnit\Framework\Attributes\Depends;
2021
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
2122
use Symfony\Component\Form\PreloadedExtension;
2223

@@ -82,9 +83,7 @@ public function testCreationForm(): Product
8283
return $product;
8384
}
8485

85-
/**
86-
* @depends testCreationForm
87-
*/
86+
#[Depends('testCreationForm')]
8887
public function testEditionForm(Product $product): void
8988
{
9089
$product->getMedias()[0]->setUrl('http://example.org/media1-edit');
@@ -121,6 +120,7 @@ public function testEditionForm(Product $product): void
121120
}
122121
}
123122

123+
#[\Override]
124124
protected function getExtensions(): array
125125
{
126126
$autoFormType = $this->getConfiguredAutoFormType();

0 commit comments

Comments
 (0)