Skip to content

Commit 5071e32

Browse files
authored
Drop support for Symfony 3 and 4 (#513)
1 parent c582f43 commit 5071e32

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use function count;
1515
use function in_array;
1616
use function is_string;
17-
use function method_exists;
1817
use function strlen;
1918
use function strpos;
2019
use function strtoupper;
@@ -34,12 +33,7 @@ public function getConfigTreeBuilder(): TreeBuilder
3433
{
3534
$treeBuilder = new TreeBuilder('doctrine_migrations');
3635

37-
if (method_exists($treeBuilder, 'getRootNode')) {
38-
$rootNode = $treeBuilder->getRootNode();
39-
} else {
40-
// BC layer for symfony/config 4.1 and older
41-
$rootNode = $treeBuilder->root('doctrine_migrations', 'array');
42-
}
36+
$rootNode = $treeBuilder->getRootNode();
4337

4438
$organizeMigrationModes = $this->getOrganizeMigrationsModes();
4539

Tests/DependencyInjection/DoctrineMigrationsExtensionTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
use Symfony\Component\DependencyInjection\Reference;
3333

3434
use function assert;
35-
use function class_exists;
3635
use function sys_get_temp_dir;
3736

3837
class DoctrineMigrationsExtensionTest extends TestCase
@@ -451,9 +450,7 @@ private function getContainer(array $config, ?array $dbalConfig = null, ?array $
451450

452451
$container->getDefinition('doctrine.migrations.dependency_factory')->setPublic(true);
453452
$container->getDefinition('doctrine.migrations.configuration')->setPublic(true);
454-
if (class_exists(CacheCompatibilityPass::class)) {
455-
$container->addCompilerPass(new CacheCompatibilityPass());
456-
}
453+
$container->addCompilerPass(new CacheCompatibilityPass());
457454

458455
return $container;
459456
}

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
],
2222
"require": {
2323
"php": "^7.2|^8.0",
24-
"symfony/framework-bundle": "~3.4|~4.0|~5.0|~6.0|~7.0",
25-
"doctrine/doctrine-bundle": "~1.0|~2.0",
24+
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
25+
"doctrine/doctrine-bundle": "^2.4",
2626
"doctrine/migrations": "^3.2"
2727
},
2828
"require-dev": {
@@ -32,8 +32,9 @@
3232
"phpstan/phpstan-deprecation-rules": "^1",
3333
"phpstan/phpstan-phpunit": "^1",
3434
"phpstan/phpstan-strict-rules": "^1.1",
35+
"phpstan/phpstan-symfony": "^1.3",
3536
"doctrine/orm": "^2.6",
36-
"doctrine/persistence": "^1.3||^2.0",
37+
"doctrine/persistence": "^2.0 || ^3 ",
3738
"vimeo/psalm": "^4.22"
3839
},
3940
"autoload": {

phpstan.neon.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ parameters:
66
- %currentWorkingDirectory%/Tests
77

88
ignoreErrors:
9-
- '~.*TreeBuilder.*getRootNode.*~'
10-
- '~.*TreeBuilder::root.*~'
119
- '~Parameter \#1 \$configs.*DoctrineMigrationsExtension::load.*~'
1210

1311
includes:
1412
- vendor/phpstan/phpstan-strict-rules/rules.neon
1513
- vendor/phpstan/phpstan-phpunit/extension.neon
1614
- vendor/phpstan/phpstan-phpunit/rules.neon
15+
- vendor/phpstan/phpstan-symfony/extension.neon
16+
- vendor/phpstan/phpstan-symfony/rules.neon

0 commit comments

Comments
 (0)