Skip to content

Commit

Permalink
Adjust PHPStan settings for ORM 3 and DBAL 4 (#1404)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Mar 1, 2024
1 parent 4f507d7 commit 833189d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Expand Up @@ -29,11 +29,11 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.3"

steps:
- name: "Checkout code"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
Expand Down
32 changes: 9 additions & 23 deletions phpstan.neon.dist
Expand Up @@ -5,6 +5,7 @@ parameters:
- tests
excludePaths:
- tests/Doctrine/Migrations/Tests/Configuration/ConfigurationTestSource/Migrations/Version123.php
- tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-orm/cli-config.php
ignoreErrors:
- '~Variable method call on Doctrine\\Migrations\\AbstractMigration~'
-
Expand Down Expand Up @@ -34,34 +35,19 @@ parameters:
paths:
- lib/Doctrine/Migrations/Version/DbalMigrationFactory.php

# We're testing legacy functionality here.
# ORM 2 + DBAL 3 backwards compatibility
-
message: """
#^Instantiation of deprecated class Doctrine\\\\ORM\\\\Tools\\\\Console\\\\Helper\\\\EntityManagerHelper\\:
This class will be removed in ORM 3\\.0 without replacement\\.$#
"""
count: 1
path: tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-orm/cli-config.php
message: '~^Call to an undefined method Doctrine\\DBAL\\Connection\:\:getEventManager\(\)\.$~'
path: lib/Doctrine/Migrations/DependencyFactory.php

-
message: """
#^Fetching class constant class of deprecated class Doctrine\\\\ORM\\\\Tools\\\\Console\\\\Helper\\\\EntityManagerHelper\\:
This class will be removed in ORM 3\\.0 without replacement\\.$#
"""
count: 1
path: tests/Doctrine/Migrations/Tests/Tools/Console/ConsoleRunnerTest.php
message: '~^Strict comparison using !== between callable\(\)\: mixed and null will always evaluate to true\.$~'
path: lib/Doctrine/Migrations/Generator/DiffGenerator.php

# TODO: deprecate using the connection event manager and expose
# our own event manager instead.
-
message: '~^Call to deprecated method getEventManager\(\) of class Doctrine\\DBAL\\Connection\.$~'
path: lib/Doctrine/Migrations/DependencyFactory.php
message: '~Doctrine\\ORM\\Tools\\Console\\Helper\\EntityManagerHelper~'
path: lib/Doctrine/Migrations/Tools/Console/ConsoleRunner.php

# DBAL 4 forward compatibility
- '~^Call to function method_exists\(\) with ''Doctrine\\\\DBAL\\\\Connection'' and ''getEventManager'' will always evaluate to true\.$~'
- '~^Class Doctrine\\DBAL\\Platforms\\SQLitePlatform not found\.$~'
- '~^Instantiated class Doctrine\\DBAL\\Platforms\\SQLitePlatform not found\.$~'
- '~^Access to constant class on an unknown class Doctrine\\DBAL\\Platforms\\SQLitePlatform\.$~'
- '~expects Doctrine\\DBAL\\Platforms\\AbstractPlatform, Doctrine\\DBAL\\Platforms\\SQLitePlatform given\.$~'
symfony:
console_application_loader: tests/Doctrine/Migrations/Tests/doctrine-migrations-phpstan-app.php
includes:
Expand Down

0 comments on commit 833189d

Please sign in to comment.