Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust PHPStan settings for ORM 3 and DBAL 4 #1404

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading