Skip to content

Commit

Permalink
use phpstan includes
Browse files Browse the repository at this point in the history
  • Loading branch information
goetas committed Oct 13, 2021
1 parent d9647b8 commit 534c4da
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 86 deletions.
11 changes: 2 additions & 9 deletions phpstan.neon.dist → phpstan-common.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ parameters:
paths:
- %currentWorkingDirectory%/lib
- %currentWorkingDirectory%/tests
excludes_analyse:
excludePaths:
- %currentWorkingDirectory%/tests/Doctrine/Migrations/Tests/Configuration/ConfigurationTestSource/Migrations/Version123.php
ignoreErrors:
- '~Variable method call on Doctrine\\Migrations\\AbstractMigration~'
Expand All @@ -13,9 +13,6 @@ parameters:
-
message: '~^Variable property access on SimpleXMLElement\.$~'
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/Configuration/Migration/XmlFile.php
-
message: "~^Casting to string something that's already string$~"
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/Tools/Console/Command/*Command.php

-
message: '~^Call to function is_bool\(\) with bool will always evaluate to true\.$~'
Expand All @@ -27,11 +24,7 @@ parameters:
message: '~^Method Doctrine\\Migrations\\Tests\\Stub\\DoctrineRegistry::getService\(\) should return Doctrine\\Persistence\\ObjectManager but returns Doctrine\\DBAL\\Connection\|Doctrine\\ORM\\EntityManager~'
path: %currentWorkingDirectory%/tests/Doctrine/Migrations/Tests/Stub/DoctrineRegistry.php
- '~Call to method getVersion\(\) of deprecated class PackageVersions\\Versions\:.*~'
-
message: '~^Instantiation of deprecated class~'
paths:
- tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-dbal/cli-config.php
- tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-wrong/cli-config.php

# Requires PHPUnit 9
-
message: '~assert.*Reg~'
Expand Down
40 changes: 3 additions & 37 deletions phpstan-dbal-2.neon.dist
Original file line number Diff line number Diff line change
@@ -1,48 +1,14 @@
includes:
- phpstan-common.neon.dist

parameters:
level: 7
paths:
- %currentWorkingDirectory%/lib
- %currentWorkingDirectory%/tests
excludes_analyse:
- %currentWorkingDirectory%/tests/Doctrine/Migrations/Tests/Configuration/ConfigurationTestSource/Migrations/Version123.php
ignoreErrors:
- '~Variable method call on Doctrine\\Migrations\\AbstractMigration~'
-
message: '~^Call to function in_array\(\) requires parameter #3 to be true\.$~'
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/Version/SortedMigrationPlanCalculator.php
-
message: '~^Variable property access on SimpleXMLElement\.$~'
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/Configuration/Migration/XmlFile.php
-
message: "~^Casting to string something that's already string~"
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/Tools/Console/Command/*Command.php

-
message: '~^Call to function is_bool\(\) with bool will always evaluate to true\.$~'
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/InlineParameterFormatter.php
-
message: '~^Call to an undefined method Symfony\\Component\\Console\\Output\\OutputInterface\:\:getErrorOutput\(\)\.$~'
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/Tools/Console/ConsoleLogger.php
-
message: '~^Method Doctrine\\Migrations\\Tests\\Stub\\DoctrineRegistry::getService\(\) should return Doctrine\\Persistence\\ObjectManager but returns Doctrine\\DBAL\\Connection\|Doctrine\\ORM\\EntityManager~'
path: %currentWorkingDirectory%/tests/Doctrine/Migrations/Tests/Stub/DoctrineRegistry.php
- '~Call to method getVersion\(\) of deprecated class PackageVersions\\Versions\:.*~'
-
message: '~^Instantiation of deprecated class~'
paths:
- tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-dbal/cli-config.php
- tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-wrong/cli-config.php
# Requires PHPUnit 9
-
message: '~assert.*Reg~'
paths:
- tests/Doctrine/Migrations/Tests/Generator/ClassNameGeneratorTest.php

symfony:
console_application_loader: %currentWorkingDirectory%/tests/Doctrine/Migrations/Tests/doctrine-migrations-phpstan-app.php
includes:
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-symfony/extension.neon
48 changes: 8 additions & 40 deletions phpstan-dbal-3.neon.dist
Original file line number Diff line number Diff line change
@@ -1,49 +1,17 @@
includes:
- phpstan-common.neon.dist

parameters:
level: 7
paths:
- %currentWorkingDirectory%/lib
- %currentWorkingDirectory%/tests
excludePaths:
- %currentWorkingDirectory%/tests/Doctrine/Migrations/Tests/Tools/Console/ConsoleRunnerTest.php
- %currentWorkingDirectory%/tests/Doctrine/Migrations/Tests/Configuration/ConfigurationTestSource/Migrations/Version123.php

ignoreErrors:
- '~Variable method call on Doctrine\\Migrations\\AbstractMigration~'
-
message: '~^Call to function in_array\(\) requires parameter #3 to be true\.$~'
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/Version/SortedMigrationPlanCalculator.php
-
message: '~^Variable property access on SimpleXMLElement\.$~'
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/Configuration/Migration/XmlFile.php
- '~^Call to deprecated method getSchemaManager\(\) of class Doctrine\\DBAL\\Connection~'
-
message: '~^Call to function is_bool\(\) with bool will always evaluate to true\.$~'
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/InlineParameterFormatter.php
- '~Doctrine\\DBAL\\Tools\\Console\\Helper\\ConnectionHelper not found~'
- '~unknown class Doctrine\\DBAL\\Tools\\Console\\Helper\\ConnectionHelper~'
-
message: '~^Call to an undefined method Symfony\\Component\\Console\\Output\\OutputInterface\:\:getErrorOutput\(\)\.$~'
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/Tools/Console/ConsoleLogger.php
-
message: '~^Method Doctrine\\Migrations\\Tests\\Stub\\DoctrineRegistry::getService\(\) should return Doctrine\\Persistence\\ObjectManager but returns Doctrine\\DBAL\\Connection\|Doctrine\\ORM\\EntityManager~'
path: %currentWorkingDirectory%/tests/Doctrine/Migrations/Tests/Stub/DoctrineRegistry.php
- '~Call to method getVersion\(\) of deprecated class PackageVersions\\Versions\:.*~'
- "~Call to function method_exists\\(\\) with Doctrine\\\\DBAL\\\\Connection and 'createSchemaManager' will always evaluate to true~"
-
message: '~^Parameter.* class Symfony\\Component\\Console\\Helper\\HelperSet constructor expects ~'
paths:
- tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-dbal/cli-config.php
- tests/Doctrine/Migrations/Tests/Tools/Console/legacy-config-wrong/cli-config.php
# Requires PHPUnit 9
-
message: '~assert.*Reg~'
paths:
- tests/Doctrine/Migrations/Tests/Generator/ClassNameGeneratorTest.php

symfony:
console_application_loader: %currentWorkingDirectory%/tests/Doctrine/Migrations/Tests/doctrine-migrations-phpstan-app.php
includes:
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-symfony/extension.neon
- '~^Call to deprecated method getSchemaManager\(\) of class Doctrine\\DBAL\\Connection~'
- '~Doctrine\\DBAL\\Tools\\Console\\Helper\\ConnectionHelper not found~'
- '~unknown class Doctrine\\DBAL\\Tools\\Console\\Helper\\ConnectionHelper~'
- "~Call to function method_exists\\(\\) with Doctrine\\\\DBAL\\\\Connection and 'createSchemaManager' will always evaluate to true~"

0 comments on commit 534c4da

Please sign in to comment.