diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 86d43e50..9d12c967 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -4,33 +4,15 @@ on: pull_request: branches: - "*.x" + paths: + - .github/workflows/static-analysis.yml + - composer.* + - config/** + - src/** + - phpstan* + - tests/StaticAnalysis/** push: jobs: - static-analysis-psalm: - name: "Static Analysis with Psalm" - runs-on: "ubuntu-20.04" - - strategy: - matrix: - php-version: - - "8.2" - - steps: - - name: "Checkout code" - uses: "actions/checkout@v4" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - - - name: "Set minimum-stability to stable in Composer" - run: "composer config minimum-stability stable" - - - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v3" - - - name: "Run a static analysis with vimeo/psalm" - run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc) --php-version=${{ matrix.php-version }}" + static-analysis: + uses: "doctrine/.github/.github/workflows/phpstan.yml@6.0.0" diff --git a/composer.json b/composer.json index 929c2ab0..0c78aca0 100644 --- a/composer.json +++ b/composer.json @@ -41,16 +41,15 @@ "require-dev": { "doctrine/coding-standard": "^11.0", "doctrine/data-fixtures": "^1.7", + "phpstan/phpstan": "^2.0", "phpunit/phpunit": "^9.5.5", - "psalm/plugin-symfony": "^5.0", "symfony/browser-kit": "^6.4 || ^7.0", "symfony/form": "^6.4 || ^7.0", "symfony/phpunit-bridge": "^6.4.1 || ^7.0.1", "symfony/security-bundle": "^6.4 || ^7.0", "symfony/stopwatch": "^6.4 || ^7.0", "symfony/validator": "^6.4 || ^7.0", - "symfony/yaml": "^6.4 || ^7.0", - "vimeo/psalm": "^5.25" + "symfony/yaml": "^6.4 || ^7.0" }, "conflict": { "doctrine/data-fixtures": "<1.3" diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 00000000..2dc1eb9c --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,805 @@ +parameters: + ignoreErrors: + - + message: '#^Class Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage not found\.$#' + identifier: class.notFound + count: 1 + path: config/value_resolver.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\APM\\CommandLoggerRegistry\:\:__construct\(\) has parameter \$commandLoggers with no value type specified in iterable type iterable\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/APM/CommandLoggerRegistry.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\ArgumentResolver\\DocumentValueResolver\:\:resolve\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/ArgumentResolver/DocumentValueResolver.php + + - + message: '#^Cannot cast array\|bool\|float\|int\|string\|UnitEnum\|null to string\.$#' + identifier: cast.string + count: 1 + path: src/CacheWarmer/HydratorCacheWarmer.php + + - + message: '#^Cannot cast array\|bool\|float\|int\|string\|UnitEnum\|null to string\.$#' + identifier: cast.string + count: 1 + path: src/CacheWarmer/PersistentCollectionCacheWarmer.php + + - + message: '#^Cannot cast array\|bool\|float\|int\|string\|UnitEnum\|null to string\.$#' + identifier: cast.string + count: 1 + path: src/CacheWarmer/ProxyCacheWarmer.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\CacheWarmer\\ProxyCacheWarmer\:\:getClassesForProxyGeneration\(\) return type with generic class Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadata does not specify its types\: T$#' + identifier: missingType.generics + count: 1 + path: src/CacheWarmer/ProxyCacheWarmer.php + + - + message: '#^Parameter \#1 \$application of static method Doctrine\\Bundle\\MongoDBBundle\\Command\\DoctrineODMCommand\:\:setApplicationDocumentManager\(\) expects Symfony\\Bundle\\FrameworkBundle\\Console\\Application, Symfony\\Component\\Console\\Application\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Command/ClearMetadataCacheDoctrineODMCommand.php + + - + message: '#^Parameter \#1 \$application of static method Doctrine\\Bundle\\MongoDBBundle\\Command\\DoctrineODMCommand\:\:setApplicationDocumentManager\(\) expects Symfony\\Bundle\\FrameworkBundle\\Console\\Application, Symfony\\Component\\Console\\Application\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Command/CreateSchemaDoctrineODMCommand.php + + - + message: '#^Call to an undefined method object\:\:getManager\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/Command/DoctrineODMCommand.php + + - + message: '#^Parameter \#1 \$application of static method Doctrine\\Bundle\\MongoDBBundle\\Command\\DoctrineODMCommand\:\:setApplicationDocumentManager\(\) expects Symfony\\Bundle\\FrameworkBundle\\Console\\Application, Symfony\\Component\\Console\\Application\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Command/DropSchemaDoctrineODMCommand.php + + - + message: '#^Parameter \#1 \$application of static method Doctrine\\Bundle\\MongoDBBundle\\Command\\DoctrineODMCommand\:\:setApplicationDocumentManager\(\) expects Symfony\\Bundle\\FrameworkBundle\\Console\\Application, Symfony\\Component\\Console\\Application\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Command/GenerateHydratorsDoctrineODMCommand.php + + - + message: '#^Parameter \#1 \$application of static method Doctrine\\Bundle\\MongoDBBundle\\Command\\DoctrineODMCommand\:\:setApplicationDocumentManager\(\) expects Symfony\\Bundle\\FrameworkBundle\\Console\\Application, Symfony\\Component\\Console\\Application\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Command/GenerateProxiesDoctrineODMCommand.php + + - + message: '#^Call to an undefined method Symfony\\Component\\Console\\Helper\\HelperInterface\:\:ask\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/Command/LoadDataFixturesDoctrineODMCommand.php + + - + message: '#^Parameter \#1 \$dm of class Doctrine\\Common\\DataFixtures\\Executor\\MongoDBExecutor constructor expects Doctrine\\ODM\\MongoDB\\DocumentManager, Doctrine\\Persistence\\ObjectManager given\.$#' + identifier: argument.type + count: 1 + path: src/Command/LoadDataFixturesDoctrineODMCommand.php + + - + message: '#^Parameter \#1 \$dm of class Doctrine\\Common\\DataFixtures\\Purger\\MongoDBPurger constructor expects Doctrine\\ODM\\MongoDB\\DocumentManager\|null, Doctrine\\Persistence\\ObjectManager given\.$#' + identifier: argument.type + count: 1 + path: src/Command/LoadDataFixturesDoctrineODMCommand.php + + - + message: '#^Parameter \#1 \$application of static method Doctrine\\Bundle\\MongoDBBundle\\Command\\DoctrineODMCommand\:\:setApplicationDocumentManager\(\) expects Symfony\\Bundle\\FrameworkBundle\\Console\\Application, Symfony\\Component\\Console\\Application\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Command/QueryDoctrineODMCommand.php + + - + message: '#^Parameter \#1 \$application of static method Doctrine\\Bundle\\MongoDBBundle\\Command\\DoctrineODMCommand\:\:setApplicationDocumentManager\(\) expects Symfony\\Bundle\\FrameworkBundle\\Console\\Application, Symfony\\Component\\Console\\Application\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Command/ShardDoctrineODMCommand.php + + - + message: '#^Parameter \#1 \$application of static method Doctrine\\Bundle\\MongoDBBundle\\Command\\DoctrineODMCommand\:\:setApplicationDocumentManager\(\) expects Symfony\\Bundle\\FrameworkBundle\\Console\\Application, Symfony\\Component\\Console\\Application\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Command/UpdateSchemaDoctrineODMCommand.php + + - + message: '#^Cannot cast array\|bool\|float\|int\|string\|UnitEnum\|null to string\.$#' + identifier: cast.string + count: 1 + path: src/DependencyInjection/Compiler/CreateHydratorDirectoryPass.php + + - + message: '#^Cannot cast array\|bool\|float\|int\|string\|UnitEnum\|null to string\.$#' + identifier: cast.string + count: 1 + path: src/DependencyInjection/Compiler/CreateProxyDirectoryPass.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass\:\:__construct\(\) has parameter \$namespaces with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/Compiler/DoctrineMongoDBMappingsPass.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass\:\:createAttributeMappingDriver\(\) has parameter \$directories with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/Compiler/DoctrineMongoDBMappingsPass.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass\:\:createAttributeMappingDriver\(\) has parameter \$namespaces with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/Compiler/DoctrineMongoDBMappingsPass.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass\:\:createPhpMappingDriver\(\) has parameter \$mappings with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/Compiler/DoctrineMongoDBMappingsPass.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass\:\:createStaticPhpMappingDriver\(\) has parameter \$directories with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/Compiler/DoctrineMongoDBMappingsPass.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass\:\:createStaticPhpMappingDriver\(\) has parameter \$namespaces with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/Compiler/DoctrineMongoDBMappingsPass.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass\:\:createXmlMappingDriver\(\) has parameter \$mappings with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/Compiler/DoctrineMongoDBMappingsPass.php + + - + message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#' + identifier: method.notFound + count: 2 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:fixXmlConfig\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:performNoDeepMerging\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface\:\:end\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Parameter \#1 \$rootNode of method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Configuration\:\:addConnectionsSection\(\) expects Symfony\\Component\\Config\\Definition\\Builder\\ArrayNodeDefinition, Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition given\.$#' + identifier: argument.type + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Parameter \#1 \$rootNode of method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Configuration\:\:addDocumentManagersSection\(\) expects Symfony\\Component\\Config\\Definition\\Builder\\ArrayNodeDefinition, Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition given\.$#' + identifier: argument.type + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Parameter \#1 \$rootNode of method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Configuration\:\:addResolveTargetDocumentsSection\(\) expects Symfony\\Component\\Config\\Definition\\Builder\\ArrayNodeDefinition, Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition given\.$#' + identifier: argument.type + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Parameter \#1 \$rootNode of method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Configuration\:\:addTypesSection\(\) expects Symfony\\Component\\Config\\Definition\\Builder\\ArrayNodeDefinition, Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition given\.$#' + identifier: argument.type + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Call to function method_exists\(\) with ''Doctrine\\\\ODM\\\\MongoDB\\\\Configuration'' and ''setUseTransactional…'' will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: src/DependencyInjection/DoctrineMongoDBExtension.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\DoctrineMongoDBExtension\:\:loadCacheDriver\(\) has parameter \$cacheDriver with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/DoctrineMongoDBExtension.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\DoctrineMongoDBExtension\:\:loadConnections\(\) has parameter \$connections with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/DoctrineMongoDBExtension.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\DoctrineMongoDBExtension\:\:loadDocumentManager\(\) has parameter \$documentManager with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/DoctrineMongoDBExtension.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\DoctrineMongoDBExtension\:\:loadDocumentManagerBundlesMappingInformation\(\) has parameter \$documentManager with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/DoctrineMongoDBExtension.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\DoctrineMongoDBExtension\:\:loadDocumentManagers\(\) has parameter \$dmConfigs with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/DoctrineMongoDBExtension.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\DoctrineMongoDBExtension\:\:overrideParameters\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/DependencyInjection/DoctrineMongoDBExtension.php + + - + message: '#^PHPDoc tag @param references unknown parameter\: \$config$#' + identifier: parameter.notFound + count: 1 + path: src/DependencyInjection/DoctrineMongoDBExtension.php + + - + message: '#^Parameter \#2 \$bundles of method Symfony\\Bridge\\Doctrine\\DependencyInjection\\AbstractDoctrineExtension\:\:fixManagersAutoMappings\(\) expects array, array\|bool\|float\|int\|string\|UnitEnum\|null given\.$#' + identifier: argument.type + count: 1 + path: src/DependencyInjection/DoctrineMongoDBExtension.php + + - + message: '#^Parameter \#2 \$haystack of function in_array expects array, array\\|false given\.$#' + identifier: argument.type + count: 1 + path: src/DependencyInjection/DoctrineMongoDBExtension.php + + - + message: '#^Call to an undefined method object\:\:register\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/DoctrineMongoDBBundle.php + + - + message: '#^Call to an undefined method object\:\:unregister\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/DoctrineMongoDBBundle.php + + - + message: '#^Parameter \#1 \$callback of function spl_autoload_register expects \(callable\(string\)\: void\)\|null, ProxyManager\\Autoloader\\AutoloaderInterface given\.$#' + identifier: argument.type + count: 1 + path: src/DoctrineMongoDBBundle.php + + - + message: '#^Parameter \#1 \$documentManager of method Doctrine\\Bundle\\MongoDBBundle\\DoctrineMongoDBBundle\:\:registerAutoloader\(\) expects Doctrine\\ODM\\MongoDB\\DocumentManager, Doctrine\\Persistence\\ObjectManager given\.$#' + identifier: argument.type + count: 1 + path: src/DoctrineMongoDBBundle.php + + - + message: '#^Cannot call method toArray\(\) on array\\|int\|object\.$#' + identifier: method.nonObject + count: 2 + path: src/Form/ChoiceList/MongoDBQueryBuilderLoader.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Form\\ChoiceList\\MongoDBQueryBuilderLoader\:\:getEntitiesByIds\(\) has parameter \$values with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/Form/ChoiceList/MongoDBQueryBuilderLoader.php + + - + message: '#^Parameter \#1 \$className of method Doctrine\\Persistence\\ObjectManager\:\:getRepository\(\) expects class\-string\, string\|null given\.$#' + identifier: argument.type + count: 1 + path: src/Form/ChoiceList/MongoDBQueryBuilderLoader.php + + - + message: '#^Unable to resolve the template type T in call to method Doctrine\\Persistence\\ObjectManager\:\:getRepository\(\)$#' + identifier: argument.templateType + count: 1 + path: src/Form/ChoiceList/MongoDBQueryBuilderLoader.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Form\\DoctrineMongoDBTypeGuesser\:\:getMetadata\(\) return type with generic class Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadata does not specify its types\: T$#' + identifier: missingType.generics + count: 1 + path: src/Form/DoctrineMongoDBTypeGuesser.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Form\\DoctrineMongoDBTypeGuesser\:\:getMetadata\(\) should return array\{Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadata, string\}\|null but returns array\{Doctrine\\Persistence\\Mapping\\ClassMetadata\, string\}\.$#' + identifier: return.type + count: 1 + path: src/Form/DoctrineMongoDBTypeGuesser.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Form\\DoctrineMongoDBTypeGuesser\:\:guessMinLength\(\) has parameter \$class with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: src/Form/DoctrineMongoDBTypeGuesser.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Form\\DoctrineMongoDBTypeGuesser\:\:guessMinLength\(\) has parameter \$property with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: src/Form/DoctrineMongoDBTypeGuesser.php + + - + message: '#^Offset ''targetDocument'' might not exist on array\{type\: string, fieldName\: string, name\: string, isCascadeRemove\: bool, isCascadePersist\: bool, isCascadeRefresh\: bool, isCascadeMerge\: bool, isCascadeDetach\: bool, \.\.\.\}\.$#' + identifier: offsetAccess.notFound + count: 1 + path: src/Form/DoctrineMongoDBTypeGuesser.php + + - + message: '#^Parameter \#1 \$className of method Doctrine\\Persistence\\ObjectManager\:\:getClassMetadata\(\) expects class\-string\, string given\.$#' + identifier: argument.type + count: 1 + path: src/Form/DoctrineMongoDBTypeGuesser.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Form\\DoctrineMongoDBTypeGuesser\:\:\$cache \(array\\) does not accept non\-empty\-array\\.$#' + identifier: assign.propertyType + count: 1 + path: src/Form/DoctrineMongoDBTypeGuesser.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Form\\DoctrineMongoDBTypeGuesser\:\:\$cache \(array\\) does not accept non\-empty\-array\, string\}\|null\>\.$#' + identifier: assign.propertyType + count: 1 + path: src/Form/DoctrineMongoDBTypeGuesser.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Form\\DoctrineMongoDBTypeGuesser\:\:\$cache with generic class Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadata does not specify its types\: T$#' + identifier: missingType.generics + count: 1 + path: src/Form/DoctrineMongoDBTypeGuesser.php + + - + message: '#^Unable to resolve the template type T in call to method Doctrine\\Persistence\\ObjectManager\:\:getClassMetadata\(\)$#' + identifier: argument.templateType + count: 1 + path: src/Form/DoctrineMongoDBTypeGuesser.php + + - + message: '#^Parameter \#1 \$queryBuilder of class Doctrine\\Bundle\\MongoDBBundle\\Form\\ChoiceList\\MongoDBQueryBuilderLoader constructor expects Closure\|Doctrine\\ODM\\MongoDB\\Query\\Builder, object given\.$#' + identifier: argument.type + count: 1 + path: src/Form/Type/DocumentType.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Loader\\SymfonyFixturesLoader\:\:createFixture\(\) has parameter \$class with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: src/Loader/SymfonyFixturesLoader.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\ManagerConfigurator\:\:__construct\(\) has parameter \$enabledFilters with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/ManagerConfigurator.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\ManagerConfigurator\:\:loadTypes\(\) has parameter \$types with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/ManagerConfigurator.php + + - + message: '#^Property Symfony\\Bridge\\Doctrine\\ManagerRegistry\:\:\$container \(Symfony\\Component\\DependencyInjection\\Container\) does not accept Psr\\Container\\ContainerInterface\|null\.$#' + identifier: assign.propertyType + count: 1 + path: src/ManagerRegistry.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Repository\\ContainerRepositoryFactory\:\:getOrCreateRepository\(\) should return Doctrine\\Persistence\\ObjectRepository\ but returns object\.$#' + identifier: return.type + count: 1 + path: src/Repository/ContainerRepositoryFactory.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Repository\\ContainerRepositoryFactory\:\:\$managedRepositories \(array\\) does not accept array\\.$#' + identifier: assign.propertyType + count: 1 + path: src/Repository/ContainerRepositoryFactory.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Repository\\ContainerRepositoryFactory\:\:\$managedRepositories with generic interface Doctrine\\Persistence\\ObjectRepository does not specify its types\: T$#' + identifier: missingType.generics + count: 1 + path: src/Repository/ContainerRepositoryFactory.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Validator\\Constraints\\Unique\:\:__construct\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/Validator/Constraints/Unique.php + + - + message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertFalse\(\) with false will always evaluate to false\.$#' + identifier: method.impossibleType + count: 1 + path: tests/CacheWarmer/HydratorCacheWarmerTest.php + + - + message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertFalse\(\) with false will always evaluate to false\.$#' + identifier: method.impossibleType + count: 1 + path: tests/CacheWarmer/PersistentCollectionCacheWarmerTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\CacheWarmer\\PersistentCollectionCacheWarmerTest\:\:provideWarmerNotExecuted\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/CacheWarmer/PersistentCollectionCacheWarmerTest.php + + - + message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertFalse\(\) with false will always evaluate to false\.$#' + identifier: method.impossibleType + count: 1 + path: tests/CacheWarmer/ProxyCacheWarmerTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\Command\\CommandTestKernel\:\:registerBundles\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/Command/CommandTestKernel.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\Command\\DoctrineODMCommandTest\:\:provideDmName\(\) return type has no value type specified in iterable type iterable\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/Command/DoctrineODMCommandTest.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Tests\\Command\\LoadDataFixturesDoctrineODMCommandTest\:\:\$command \(Doctrine\\Bundle\\MongoDBBundle\\Command\\LoadDataFixturesDoctrineODMCommand\) does not accept Symfony\\Component\\Console\\Command\\Command\.$#' + identifier: assign.propertyType + count: 1 + path: tests/Command/LoadDataFixturesDoctrineODMCommandTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\ContainerTest\:\:provideDataCollectorConfigs\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/ContainerTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\ContainerTest\:\:provideLoggerConfigs\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/ContainerTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\ContainerTest\:\:testDataCollectorConfig\(\) has parameter \$config with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/ContainerTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\ContainerTest\:\:testLoggerConfig\(\) has parameter \$config with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/ContainerTest.php + + - + message: '#^Parameter \#2 \$haystack of function in_array expects array, array\\|false given\.$#' + identifier: argument.type + count: 1 + path: tests/DependencyInjection/AbstractMongoDBExtensionTestCase.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\ConfigurationTest\:\:testFullConfiguration\(\) has parameter \$config with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/DependencyInjection/ConfigurationTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\ConfigurationTest\:\:testMergeOptions\(\) has parameter \$configs with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/DependencyInjection/ConfigurationTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\ConfigurationTest\:\:testMergeOptions\(\) has parameter \$expected with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/DependencyInjection/ConfigurationTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\ConfigurationTest\:\:testNormalizeOptions\(\) has parameter \$config with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/DependencyInjection/ConfigurationTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\ConfigurationTest\:\:testNormalizeOptions\(\) has parameter \$expected with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/DependencyInjection/ConfigurationTest.php + + - + message: '#^PHPDoc tag @param references unknown parameter\: \$configs$#' + identifier: parameter.notFound + count: 1 + path: tests/DependencyInjection/ConfigurationTest.php + + - + message: '#^Parameter \#1 \$input of static method Symfony\\Component\\Yaml\\Yaml\:\:parse\(\) expects string, string\|false given\.$#' + identifier: argument.type + count: 1 + path: tests/DependencyInjection/ConfigurationTest.php + + - + message: '#^Instantiated class Composer\\Semver\\VersionParser not found\.$#' + identifier: class.notFound + count: 3 + path: tests/DependencyInjection/DoctrineMongoDBExtensionTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\DoctrineMongoDBExtensionTest\:\:assertDICDefinitionMethodCall\(\) has parameter \$params with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/DependencyInjection/DoctrineMongoDBExtensionTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\DoctrineMongoDBExtensionTest\:\:buildConfiguration\(\) has parameter \$settings with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/DependencyInjection/DoctrineMongoDBExtensionTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\DoctrineMongoDBExtensionTest\:\:buildConfiguration\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/DependencyInjection/DoctrineMongoDBExtensionTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\DoctrineMongoDBExtensionTest\:\:getAutomappingConfigurations\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/DependencyInjection/DoctrineMongoDBExtensionTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\DoctrineMongoDBExtensionTest\:\:parameterProvider\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/DependencyInjection/DoctrineMongoDBExtensionTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\DoctrineMongoDBExtensionTest\:\:testAutomapping\(\) has parameter \$documentManagers with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/DependencyInjection/DoctrineMongoDBExtensionTest.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\Fixtures\\Bundles\\RepositoryServiceBundle\\Document\\TestCustomClassRepoDocument\:\:\$id is unused\.$#' + identifier: property.unused + count: 1 + path: tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Document/TestCustomClassRepoDocument.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\Fixtures\\Bundles\\RepositoryServiceBundle\\Document\\TestCustomServiceRepoDocument\:\:\$id is unused\.$#' + identifier: property.unused + count: 1 + path: tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Document/TestCustomServiceRepoDocument.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\Fixtures\\Bundles\\RepositoryServiceBundle\\Document\\TestCustomServiceRepoFile\:\:\$id is unused\.$#' + identifier: property.unused + count: 1 + path: tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Document/TestCustomServiceRepoFile.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\Fixtures\\Bundles\\RepositoryServiceBundle\\Document\\TestDefaultRepoDocument\:\:\$id is unused\.$#' + identifier: property.unused + count: 1 + path: tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Document/TestDefaultRepoDocument.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\Fixtures\\Bundles\\RepositoryServiceBundle\\Document\\TestDefaultRepoFile\:\:\$id is unused\.$#' + identifier: property.unused + count: 1 + path: tests/DependencyInjection/Fixtures/Bundles/RepositoryServiceBundle/Document/TestDefaultRepoFile.php + + - + message: '#^Call to an undefined method object\:\:flush\(\)\.$#' + identifier: method.notFound + count: 2 + path: tests/DocumentValueResolverFunctionalTest.php + + - + message: '#^Call to an undefined method object\:\:persist\(\)\.$#' + identifier: method.notFound + count: 2 + path: tests/DocumentValueResolverFunctionalTest.php + + - + message: '#^Call to an undefined method object\:\:remove\(\)\.$#' + identifier: method.notFound + count: 2 + path: tests/DocumentValueResolverFunctionalTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\FooTestKernel\:\:registerBundles\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/DocumentValueResolverFunctionalTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\IntegrationTestKernel\:\:registerBundles\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/FixtureIntegrationTest.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Tests\\Fixtures\\CommandBundle\\Document\\User\:\:\$id \(string\|null\) is never assigned string so it can be removed from the property type\.$#' + identifier: property.unusedType + count: 1 + path: tests/Fixtures/CommandBundle/Document/User.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Tests\\Fixtures\\CommandBundle\\Document\\User\:\:\$id is never read, only written\.$#' + identifier: property.onlyWritten + count: 1 + path: tests/Fixtures/CommandBundle/Document/User.php + + - + message: '#^Constructor of class Doctrine\\Bundle\\MongoDBBundle\\Tests\\Fixtures\\FooBundle\\DataFixtures\\RequiredConstructorArgsFixtures has an unused parameter \$fooRequiredArg\.$#' + identifier: constructor.unusedParameter + count: 1 + path: tests/Fixtures/FooBundle/DataFixtures/RequiredConstructorArgsFixtures.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Tests\\Fixtures\\Form\\Guesser\:\:\$collectionField type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/Fixtures/Form/Guesser.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\Fixtures\\Security\\User\:\:getUserIdentifier\(\) should return non\-empty\-string but returns string\.$#' + identifier: return.type + count: 1 + path: tests/Fixtures/Security/User.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Tests\\Fixtures\\Validator\\Document\:\:\$collection type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/Fixtures/Validator/Document.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Tests\\Fixtures\\Validator\\Document\:\:\$hash type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/Fixtures/Validator/Document.php + + - + message: '#^Binary operation "\." between ''\?\>'' and array\|string results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: tests/ManagerRegistryTest.php + + - + message: '#^Call to an undefined method object\:\:flush\(\)\.$#' + identifier: method.notFound + count: 2 + path: tests/ManagerRegistryTest.php + + - + message: '#^PHPDoc tag @var with type class\-string\ is not subtype of native type ''MongoDBManagerRepos…''\.$#' + identifier: varTag.nativeType + count: 1 + path: tests/ManagerRegistryTest.php + + - + message: '#^Parameter \#6 \$proxyInterfaceName of class Doctrine\\Bundle\\MongoDBBundle\\ManagerRegistry constructor expects class\-string, string given\.$#' + identifier: argument.type + count: 1 + path: tests/ManagerRegistryTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\Mapping\\Driver\\AbstractDriverTestCase\:\:getDriver\(\) has parameter \$paths with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/Mapping/Driver/AbstractDriverTestCase.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\Mapping\\Driver\\AbstractDriverTestCase\:\:getDriver\(\) return type with generic class Doctrine\\Persistence\\Mapping\\Driver\\FileDriver does not specify its types\: T$#' + identifier: missingType.generics + count: 1 + path: tests/Mapping/Driver/AbstractDriverTestCase.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\Mapping\\Driver\\AbstractDriverTestCase\:\:getDriverLocator\(\) has parameter \$driver with generic class Doctrine\\Persistence\\Mapping\\Driver\\FileDriver but does not specify its types\: T$#' + identifier: missingType.generics + count: 1 + path: tests/Mapping/Driver/AbstractDriverTestCase.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\Mapping\\Driver\\XmlDriverTest\:\:getDriver\(\) has parameter \$paths with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/Mapping/Driver/XmlDriverTest.php + + - + message: '#^Call to an undefined method Doctrine\\ODM\\MongoDB\\DocumentManager\|PHPUnit\\Framework\\MockObject\\MockObject\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound + count: 1 + path: tests/Repository/ContainerRepositoryFactoryTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\Repository\\ContainerRepositoryFactoryTest\:\:createContainer\(\) has parameter \$services with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/Repository/ContainerRepositoryFactoryTest.php + + - + message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Tests\\Repository\\ContainerRepositoryFactoryTest\:\:createDocumentManager\(\) has parameter \$documentRepositoryClasses with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: tests/Repository/ContainerRepositoryFactoryTest.php + + - + message: '#^Parameter \#1 \$container of class Doctrine\\Bundle\\MongoDBBundle\\Repository\\ContainerRepositoryFactory constructor expects Psr\\Container\\ContainerInterface, PHPUnit\\Framework\\MockObject\\MockObject\|Psr\\Container\\ContainerInterface given\.$#' + identifier: argument.type + count: 6 + path: tests/Repository/ContainerRepositoryFactoryTest.php + + - + message: '#^Parameter \#1 \$dm of class Doctrine\\Bundle\\MongoDBBundle\\Tests\\Repository\\StubRepository constructor expects Doctrine\\ODM\\MongoDB\\DocumentManager, Doctrine\\ODM\\MongoDB\\DocumentManager\|PHPUnit\\Framework\\MockObject\\MockObject given\.$#' + identifier: argument.type + count: 1 + path: tests/Repository/ContainerRepositoryFactoryTest.php + + - + message: '#^Parameter \#1 \$documentManager of method Doctrine\\Bundle\\MongoDBBundle\\Repository\\ContainerRepositoryFactory\:\:getRepository\(\) expects Doctrine\\ODM\\MongoDB\\DocumentManager, Doctrine\\ODM\\MongoDB\\DocumentManager\|PHPUnit\\Framework\\MockObject\\MockObject given\.$#' + identifier: argument.type + count: 8 + path: tests/Repository/ContainerRepositoryFactoryTest.php + + - + message: '#^Parameter \#1 \$documentName of class Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadata constructor expects class\-string\, \(int\|string\) given\.$#' + identifier: argument.type + count: 1 + path: tests/Repository/ContainerRepositoryFactoryTest.php + + - + message: '#^Call to an undefined method object\:\:getRepository\(\)\.$#' + identifier: method.notFound + count: 8 + path: tests/ServiceRepositoryTest.php + + - + message: '#^Parameter \#1 \$registry of class Doctrine\\Bundle\\MongoDBBundle\\Tests\\DependencyInjection\\Fixtures\\Bundles\\RepositoryServiceBundle\\Repository\\TestUnmappedDocumentRepository constructor expects Doctrine\\Bundle\\MongoDBBundle\\ManagerRegistry, object given\.$#' + identifier: argument.type + count: 1 + path: tests/ServiceRepositoryTest.php + + - + message: '#^Property Doctrine\\Bundle\\MongoDBBundle\\Tests\\Validator\\Constraints\\UniqueDocumentDummyOne\:\:\$email is unused\.$#' + identifier: property.unused + count: 1 + path: tests/Validator/Constraints/UniqueTest.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 00000000..bb852bd2 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,10 @@ +includes: + - phpstan-baseline.neon + +parameters: + phpVersion: 80400 + level: 7 + paths: + - config + - src + - tests diff --git a/psalm-baseline.xml b/psalm-baseline.xml deleted file mode 100644 index 349db7da..00000000 --- a/psalm-baseline.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index dbb27339..00000000 --- a/psalm.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/CacheWarmer/HydratorCacheWarmer.php b/src/CacheWarmer/HydratorCacheWarmer.php index 53fdf401..4183b01e 100644 --- a/src/CacheWarmer/HydratorCacheWarmer.php +++ b/src/CacheWarmer/HydratorCacheWarmer.php @@ -26,8 +26,6 @@ * since this information is necessary to build the hydrators in the first place. * * @internal - * - * @psalm-suppress ContainerDependency */ class HydratorCacheWarmer implements CacheWarmerInterface { diff --git a/src/CacheWarmer/PersistentCollectionCacheWarmer.php b/src/CacheWarmer/PersistentCollectionCacheWarmer.php index 887b702b..90592c30 100644 --- a/src/CacheWarmer/PersistentCollectionCacheWarmer.php +++ b/src/CacheWarmer/PersistentCollectionCacheWarmer.php @@ -27,8 +27,6 @@ * since this information is necessary to build the persistent collections in the first place. * * @internal - * - * @psalm-suppress ContainerDependency */ class PersistentCollectionCacheWarmer implements CacheWarmerInterface { diff --git a/src/CacheWarmer/ProxyCacheWarmer.php b/src/CacheWarmer/ProxyCacheWarmer.php index f8b6ea67..ad792384 100644 --- a/src/CacheWarmer/ProxyCacheWarmer.php +++ b/src/CacheWarmer/ProxyCacheWarmer.php @@ -28,8 +28,6 @@ * since this information is necessary to build the proxies in the first place. * * @internal - * - * @psalm-suppress ContainerDependency */ class ProxyCacheWarmer implements CacheWarmerInterface { diff --git a/src/DependencyInjection/DoctrineMongoDBExtension.php b/src/DependencyInjection/DoctrineMongoDBExtension.php index 297c2dca..2e89d191 100644 --- a/src/DependencyInjection/DoctrineMongoDBExtension.php +++ b/src/DependencyInjection/DoctrineMongoDBExtension.php @@ -384,7 +384,6 @@ protected function loadConnections(array $connections, ContainerBuilder $contain private function loadMessengerServices(ContainerBuilder $container, FileLoader $loader): void { - /** @psalm-suppress UndefinedClass Optional dependency */ if (! interface_exists(MessageBusInterface::class) || ! class_exists(DoctrineClearEntityManagerWorkerSubscriber::class)) { return; } @@ -568,8 +567,6 @@ public function getXsdValidationBasePath(): string * Loads a cache driver. * * @throws InvalidArgumentException - * - * @psalm-suppress UndefinedClass this won't be necessary when removing metadata cache configuration */ protected function loadCacheDriver(string $cacheName, string $objectManagerName, array $cacheDriver, ContainerBuilder $container): string { diff --git a/src/Repository/ContainerRepositoryFactory.php b/src/Repository/ContainerRepositoryFactory.php index 374d0490..4524d22c 100644 --- a/src/Repository/ContainerRepositoryFactory.php +++ b/src/Repository/ContainerRepositoryFactory.php @@ -33,9 +33,9 @@ public function __construct(private ContainerInterface $container) } /** - * @psalm-param class-string $documentName + * @phpstan-param class-string $documentName * - * @psalm-return ObjectRepository + * @phpstan-return ObjectRepository * * @template T of object */ @@ -73,9 +73,9 @@ public function getRepository(DocumentManager $documentManager, string $document } /** - * @psalm-param ClassMetadata $metadata + * @phpstan-param ClassMetadata $metadata * - * @psalm-return ObjectRepository + * @phpstan-return ObjectRepository * * @template T of object */ @@ -83,17 +83,17 @@ private function getOrCreateRepository(DocumentManager $documentManager, ClassMe { $repositoryHash = $metadata->getName() . spl_object_hash($documentManager); if (isset($this->managedRepositories[$repositoryHash])) { - /** @psalm-var ObjectRepository */ + /** @phpstan-var ObjectRepository */ return $this->managedRepositories[$repositoryHash]; } if ($metadata->customRepositoryClassName) { $repositoryClassName = $metadata->customRepositoryClassName; } elseif ($metadata->isFile) { - /** @psalm-var class-string> $repositoryClassName */ + /** @phpstan-var class-string> $repositoryClassName */ $repositoryClassName = $documentManager->getConfiguration()->getDefaultGridFSRepositoryClassName(); } else { - /** @psalm-var class-string> $repositoryClassName */ + /** @phpstan-var class-string> $repositoryClassName */ $repositoryClassName = $documentManager->getConfiguration()->getDefaultDocumentRepositoryClassName(); } diff --git a/src/Repository/ServiceRepositoryTrait.php b/src/Repository/ServiceRepositoryTrait.php index 54478a8b..c5445da1 100644 --- a/src/Repository/ServiceRepositoryTrait.php +++ b/src/Repository/ServiceRepositoryTrait.php @@ -17,7 +17,7 @@ trait ServiceRepositoryTrait /** * @param ManagerRegistry $registry The ManagerRegistry to use * @param string $documentClass The class name of the entity this repository manages - * @psalm-param class-string $documentClass + * @phpstan-param class-string $documentClass */ public function __construct(ManagerRegistry $registry, string $documentClass) { diff --git a/tests/DependencyInjection/AbstractMongoDBExtensionTestCase.php b/tests/DependencyInjection/AbstractMongoDBExtensionTestCase.php index 29175548..6222e5bf 100644 --- a/tests/DependencyInjection/AbstractMongoDBExtensionTestCase.php +++ b/tests/DependencyInjection/AbstractMongoDBExtensionTestCase.php @@ -37,7 +37,6 @@ abstract class AbstractMongoDBExtensionTestCase extends TestCase { abstract protected function loadFromFile(ContainerBuilder $container, string $file): void; - /** @psalm-suppress UndefinedClass this won't be necessary when removing metadata cache configuration */ public function testDependencyInjectionConfigurationDefaults(): void { $container = $this->getContainer(); @@ -335,7 +334,6 @@ public function testDocumentManagerMetadataCacheDriverConfiguration(): void $this->assertEquals(ApcuAdapter::class, $definition->getClass()); } - /** @psalm-suppress UndefinedClass this won't be necessary when removing metadata cache configuration */ public function testDocumentManagerMemcachedMetadataCacheDriverConfiguration(): void { $container = $this->getContainer(); diff --git a/tests/DependencyInjection/DoctrineMongoDBExtensionTest.php b/tests/DependencyInjection/DoctrineMongoDBExtensionTest.php index 049345ee..9f20cb38 100644 --- a/tests/DependencyInjection/DoctrineMongoDBExtensionTest.php +++ b/tests/DependencyInjection/DoctrineMongoDBExtensionTest.php @@ -311,7 +311,6 @@ public function testPublicServicesAndAliases(): void public function testMessengerIntegration(): void { - /** @psalm-suppress UndefinedClass Optional dependency */ if (! interface_exists(MessageBusInterface::class)) { $this->markTestSkipped('Symfony Messenger component is not installed'); }