diff --git a/.gitattributes b/.gitattributes index 0bb8cba..5fef55d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,5 +5,4 @@ /phpcs.xml.dist export-ignore /phpstan.neon export-ignore /phpunit.xml.dist export-ignore -/psalm.xml export-ignore /tests/ export-ignore diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/phpstan.yml similarity index 57% rename from .github/workflows/static-analysis.yml rename to .github/workflows/phpstan.yml index 8dc4c41..3aadefa 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/phpstan.yml @@ -1,30 +1,28 @@ -name: "Static Analysis" +name: "Static Analysis with PHPStan" on: pull_request: branches: - "*.x" paths: - - ".github/workflows/static-analysis.yml" + - ".github/workflows/phpstan.yml" - "composer.*" - "src/**" - "phpstan*" - - "psalm*" - "tests/**" push: branches: - "*.x" paths: - - ".github/workflows/static-analysis.yml" + - ".github/workflows/phpstan.yml" - "composer.*" - "src/**" - "phpstan*" - - "psalm*" - "tests/**" jobs: - static-analysis: + phpstan: name: "Static Analysis" - uses: "doctrine/.github/.github/workflows/static-analysis.yml@6.0.0" + uses: "doctrine/.github/.github/workflows/phpstan.yml@6.0.0" with: php-version: "8.3" diff --git a/composer.json b/composer.json index 1ee674e..2d6046f 100644 --- a/composer.json +++ b/composer.json @@ -25,8 +25,8 @@ "doctrine/coding-standard": "^12.0.0", "phpdocumentor/guides-cli": "^1.5.0", "phpstan/phpstan": "^2.0.2", - "phpunit/phpunit": "^10.5.38", - "vimeo/psalm": "^5.26.1" + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpunit/phpunit": "^10.5.38" }, "autoload": { "psr-4": { @@ -48,13 +48,11 @@ "check": [ "@cs-check", "@phpstan", - "@psalm", "@test" ], "cs-check": "phpcs", "cs-fix": "phpcbf", "phpstan": "phpstan analyse", - "psalm": "psalm --stats", "test": "phpunit --colors=always", "test-coverage": "phpunit --colors=always --coverage-clover=coverage.xml" } diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index bd50f25..0000000 --- a/psalm.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - diff --git a/src/DoctrineObject.php b/src/DoctrineObject.php index 77b3ae5..049285e 100644 --- a/src/DoctrineObject.php +++ b/src/DoctrineObject.php @@ -329,9 +329,9 @@ public function hydrateValue(string $name, $value, array|null $data = null) * Caution: Parameter $object should not be null, signature will be changed to not-nullable in next major * * @param array $data - * @psalm-param T $object + * @phpstan-param T $object * - * @psalm-return T + * @phpstan-return T * * @throws RuntimeException * @@ -394,9 +394,9 @@ protected function hydrateByValue(array $data, object|null $object): object * Caution: Parameter $object should not be null, signature will be changed to not-nullable in next major * * @param array $data - * @psalm-param T $object + * @phpstan-param T $object * - * @psalm-return T + * @phpstan-return T * * @template T of object */ @@ -459,9 +459,9 @@ protected function hydrateByReference(array $data, object|null $object): object * tricks like setting manually the existing id directly into the entity * * @param array $data The data that may contain identifiers keys - * @psalm-param T $object + * @phpstan-param T $object * - * @psalm-return T|null + * @phpstan-return T|null * * @template T of object */ @@ -692,9 +692,9 @@ protected function handleTypeConversions(mixed $value, string|null $typeOfField) /** * Find an object by a given target class and identifier * - * @psalm-param class-string $targetClass + * @phpstan-param class-string $targetClass * - * @psalm-return T|null + * @phpstan-return T|null * * @template T of object */ diff --git a/tests/Assets/OneToManyArrayEntity.php b/tests/Assets/OneToManyArrayEntity.php index d5552d5..4cdfbe0 100644 --- a/tests/Assets/OneToManyArrayEntity.php +++ b/tests/Assets/OneToManyArrayEntity.php @@ -29,7 +29,7 @@ public function getId(): int return $this->id; } - /** @psalm-param Collection $entities */ + /** @param Collection $entities */ public function addEntities(Collection $entities, bool $modifyValue = true): void { foreach ($entities as $entity) {