Skip to content

Commit

Permalink
Drop support for Symfony 3 and 4 (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Nov 13, 2023
1 parent c582f43 commit 5071e32
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
8 changes: 1 addition & 7 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use function count;
use function in_array;
use function is_string;
use function method_exists;
use function strlen;
use function strpos;
use function strtoupper;
Expand All @@ -34,12 +33,7 @@ public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('doctrine_migrations');

if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder->root('doctrine_migrations', 'array');
}
$rootNode = $treeBuilder->getRootNode();

$organizeMigrationModes = $this->getOrganizeMigrationsModes();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
use Symfony\Component\DependencyInjection\Reference;

use function assert;
use function class_exists;
use function sys_get_temp_dir;

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

$container->getDefinition('doctrine.migrations.dependency_factory')->setPublic(true);
$container->getDefinition('doctrine.migrations.configuration')->setPublic(true);
if (class_exists(CacheCompatibilityPass::class)) {
$container->addCompilerPass(new CacheCompatibilityPass());
}
$container->addCompilerPass(new CacheCompatibilityPass());

return $container;
}
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
],
"require": {
"php": "^7.2|^8.0",
"symfony/framework-bundle": "~3.4|~4.0|~5.0|~6.0|~7.0",
"doctrine/doctrine-bundle": "~1.0|~2.0",
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
"doctrine/doctrine-bundle": "^2.4",
"doctrine/migrations": "^3.2"
},
"require-dev": {
Expand All @@ -32,8 +32,9 @@
"phpstan/phpstan-deprecation-rules": "^1",
"phpstan/phpstan-phpunit": "^1",
"phpstan/phpstan-strict-rules": "^1.1",
"phpstan/phpstan-symfony": "^1.3",
"doctrine/orm": "^2.6",
"doctrine/persistence": "^1.3||^2.0",
"doctrine/persistence": "^2.0 || ^3 ",
"vimeo/psalm": "^4.22"
},
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ parameters:
- %currentWorkingDirectory%/Tests

ignoreErrors:
- '~.*TreeBuilder.*getRootNode.*~'
- '~.*TreeBuilder::root.*~'
- '~Parameter \#1 \$configs.*DoctrineMigrationsExtension::load.*~'

includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/phpstan/phpstan-symfony/extension.neon
- vendor/phpstan/phpstan-symfony/rules.neon

0 comments on commit 5071e32

Please sign in to comment.