diff --git a/composer.json b/composer.json index e211f8c2d..7cf9972e1 100644 --- a/composer.json +++ b/composer.json @@ -87,14 +87,14 @@ }, "require-dev": { "doctrine/doctrine-fixtures-bundle": "^3.4", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-deprecation-rules": "^1.1", - "phpstan/phpstan-doctrine": "^1", - "phpstan/phpstan-symfony": "^1.1", - "phpstan/phpstan-webmozart-assert": "^1.2", + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-doctrine": "^2", + "phpstan/phpstan-symfony": "^2", + "phpstan/phpstan-webmozart-assert": "^2", "phpunit/phpunit": "^11.0", - "staabm/phpstan-dba": "^0.2", - "staabm/phpstan-todo-by": "^0.1.27", + "staabm/phpstan-dba": "^0.3", + "staabm/phpstan-todo-by": "^0.2", "symfony/browser-kit": "^7", "symfony/css-selector": "^7", "symfony/debug-bundle": "^7", diff --git a/composer.lock b/composer.lock index f630cce64..97e3e6601 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "07b2201477fbd47cc6123ba1927261b9", + "content-hash": "3f63f0baa312455a7b836dcc6baf3739", "packages": [ { "name": "algolia/algoliasearch-client-php", @@ -504,12 +504,12 @@ "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "2e7b006134ebafe996085e661929e81c7a58b175" + "reference": "5eeba719d3f1388f68773c28e3971a7f441ee919" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/2e7b006134ebafe996085e661929e81c7a58b175", - "reference": "2e7b006134ebafe996085e661929e81c7a58b175", + "url": "https://api.github.com/repos/composer/composer/zipball/5eeba719d3f1388f68773c28e3971a7f441ee919", + "reference": "5eeba719d3f1388f68773c28e3971a7f441ee919", "shasum": "" }, "require": { @@ -611,7 +611,7 @@ "type": "tidelift" } ], - "time": "2024-11-26T13:52:33+00:00" + "time": "2024-11-26T16:10:11+00:00" }, { "name": "composer/metadata-minifier", @@ -12039,20 +12039,20 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.11", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "0d1fc20a962a91be578bcfe7cf939e6e1a2ff733" + "reference": "6c98c7600fc717b2c78c11ef60040d5b1e359c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d1fc20a962a91be578bcfe7cf939e6e1a2ff733", - "reference": "0d1fc20a962a91be578bcfe7cf939e6e1a2ff733", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6c98c7600fc717b2c78c11ef60040d5b1e359c82", + "reference": "6c98c7600fc717b2c78c11ef60040d5b1e359c82", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -12093,30 +12093,30 @@ "type": "github" } ], - "time": "2024-11-17T14:08:01+00:00" + "time": "2024-11-17T14:17:00+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", - "version": "1.2.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "f94d246cc143ec5a23da868f8f7e1393b50eaa82" + "reference": "81833b5787e2e8f451b31218875e29e4ed600ab2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/f94d246cc143ec5a23da868f8f7e1393b50eaa82", - "reference": "f94d246cc143ec5a23da868f8f7e1393b50eaa82", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/81833b5787e2e8f451b31218875e29e4ed600ab2", + "reference": "81833b5787e2e8f451b31218875e29e4ed600ab2", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.12" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.0" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5" + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6" }, "type": "phpstan-extension", "extra": { @@ -12138,27 +12138,27 @@ "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", "support": { "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", - "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.2.1" + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/2.0.0" }, - "time": "2024-09-11T15:52:35+00:00" + "time": "2024-10-26T16:04:11+00:00" }, { "name": "phpstan/phpstan-doctrine", - "version": "1.5.6", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-doctrine.git", - "reference": "8ba022846e79238872e315fff61e19b42ba2f139" + "reference": "90c42756b2d7c3660b423d328622d4dfa2194487" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/8ba022846e79238872e315fff61e19b42ba2f139", - "reference": "8ba022846e79238872e315fff61e19b42ba2f139", + "url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/90c42756b2d7c3660b423d328622d4dfa2194487", + "reference": "90c42756b2d7c3660b423d328622d4dfa2194487", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.12.6" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.0" }, "conflict": { "doctrine/collections": "<1.0", @@ -12171,20 +12171,19 @@ "cache/array-adapter": "^1.1", "composer/semver": "^3.3.2", "cweagans/composer-patches": "^1.7.3", - "doctrine/annotations": "^1.11 || ^2.0", + "doctrine/annotations": "^2.0", "doctrine/collections": "^1.6 || ^2.1", "doctrine/common": "^2.7 || ^3.0", - "doctrine/dbal": "^2.13.8 || ^3.3.3", + "doctrine/dbal": "^3.3.8", "doctrine/lexer": "^2.0 || ^3.0", - "doctrine/mongodb-odm": "^1.3 || ^2.4.3", + "doctrine/mongodb-odm": "^2.4.3", "doctrine/orm": "^2.16.0", "doctrine/persistence": "^2.2.1 || ^3.2", "gedmo/doctrine-extensions": "^3.8", "nesbot/carbon": "^2.49", - "nikic/php-parser": "^4.13.2", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^1.3.13", - "phpstan/phpstan-strict-rules": "^1.5.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", "phpunit/phpunit": "^9.6.20", "ramsey/uuid": "^4.2", "symfony/cache": "^5.4" @@ -12210,38 +12209,37 @@ "description": "Doctrine extensions for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-doctrine/issues", - "source": "https://github.com/phpstan/phpstan-doctrine/tree/1.5.6" + "source": "https://github.com/phpstan/phpstan-doctrine/tree/2.0.0" }, - "time": "2024-11-09T17:34:01+00:00" + "time": "2024-11-09T17:34:32+00:00" }, { "name": "phpstan/phpstan-symfony", - "version": "1.4.12", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "c7b7e7f520893621558bfbfdb2694d4364565c1d" + "reference": "1ef4dce2baabd464c2dd3109d051bad94efa1e79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/c7b7e7f520893621558bfbfdb2694d4364565c1d", - "reference": "c7b7e7f520893621558bfbfdb2694d4364565c1d", + "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/1ef4dce2baabd464c2dd3109d051bad94efa1e79", + "reference": "1ef4dce2baabd464c2dd3109d051bad94efa1e79", "shasum": "" }, "require": { "ext-simplexml": "*", - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.12" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.0" }, "conflict": { "symfony/framework-bundle": "<3.0" }, "require-dev": { - "nikic/php-parser": "^4.13.0", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^1.3.11", - "phpstan/phpstan-strict-rules": "^1.5.1", - "phpunit/phpunit": "^8.5.29 || ^9.5", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "psr/container": "1.0 || 1.1.1", "symfony/config": "^5.4 || ^6.1", "symfony/console": "^5.4 || ^6.1", @@ -12282,35 +12280,35 @@ "description": "Symfony Framework extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-symfony/issues", - "source": "https://github.com/phpstan/phpstan-symfony/tree/1.4.12" + "source": "https://github.com/phpstan/phpstan-symfony/tree/2.0.0" }, - "time": "2024-11-06T10:13:18+00:00" + "time": "2024-11-06T10:13:40+00:00" }, { "name": "phpstan/phpstan-webmozart-assert", - "version": "1.2.11", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-webmozart-assert.git", - "reference": "960dd44e8466191590dd0d7940d3e9496eebebbd" + "reference": "0c641817d2a8f05c7157f92d91986e74d3c8ab0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-webmozart-assert/zipball/960dd44e8466191590dd0d7940d3e9496eebebbd", - "reference": "960dd44e8466191590dd0d7940d3e9496eebebbd", + "url": "https://api.github.com/repos/phpstan/phpstan-webmozart-assert/zipball/0c641817d2a8f05c7157f92d91986e74d3c8ab0c", + "reference": "0c641817d2a8f05c7157f92d91986e74d3c8ab0c", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.12" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.0" }, "require-dev": { - "nikic/php-parser": "^4.13.0", + "nikic/php-parser": "^5.1", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-deprecation-rules": "^1.2", - "phpstan/phpstan-phpunit": "^1.4", - "phpstan/phpstan-strict-rules": "^1.6", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "webmozart/assert": "^1.11.0" }, "type": "phpstan-extension", @@ -12333,9 +12331,9 @@ "description": "PHPStan webmozart/assert extension", "support": { "issues": "https://github.com/phpstan/phpstan-webmozart-assert/issues", - "source": "https://github.com/phpstan/phpstan-webmozart-assert/tree/1.2.11" + "source": "https://github.com/phpstan/phpstan-webmozart-assert/tree/2.0.0" }, - "time": "2024-09-11T15:48:08+00:00" + "time": "2024-10-14T03:45:26+00:00" }, { "name": "phpunit/php-code-coverage", @@ -13685,16 +13683,16 @@ }, { "name": "staabm/phpstan-dba", - "version": "0.2.85", + "version": "0.3.1", "source": { "type": "git", "url": "https://github.com/staabm/phpstan-dba.git", - "reference": "f55924169165d70e6eafb9479f6d061420bfdc21" + "reference": "6dac52ebaa925ea05b3e178ed3bb4dbf87be29f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/staabm/phpstan-dba/zipball/f55924169165d70e6eafb9479f6d061420bfdc21", - "reference": "f55924169165d70e6eafb9479f6d061420bfdc21", + "url": "https://api.github.com/repos/staabm/phpstan-dba/zipball/6dac52ebaa925ea05b3e178ed3bb4dbf87be29f2", + "reference": "6dac52ebaa925ea05b3e178ed3bb4dbf87be29f2", "shasum": "" }, "require": { @@ -13702,7 +13700,7 @@ "composer/semver": "^3.2", "doctrine/dbal": "3.*", "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^1.9.4" + "phpstan/phpstan": "^2.0" }, "conflict": { "sqlftw/sqlftw": "<0.1.16" @@ -13713,13 +13711,11 @@ "ext-pdo": "*", "php-parallel-lint/php-parallel-lint": "^1.4", "phpstan/extension-installer": "^1.4", - "phpstan/phpstan-deprecation-rules": "^1.1", - "phpstan/phpstan-php-parser": "^1.1", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", "phpunit/phpunit": "^8.5|^9.5", "symplify/easy-coding-standard": "^12.3", - "tomasvotruba/unused-public": "^1.0", "vlucas/phpdotenv": "^5.4" }, "type": "phpstan-extension", @@ -13728,6 +13724,9 @@ "includes": [ "config/dba.neon" ] + }, + "branch-alias": { + "dev-main": "0.3.x-dev" } }, "autoload": { @@ -13749,7 +13748,7 @@ ], "support": { "issues": "https://github.com/staabm/phpstan-dba/issues", - "source": "https://github.com/staabm/phpstan-dba/tree/0.2.85" + "source": "https://github.com/staabm/phpstan-dba/tree/0.3.1" }, "funding": [ { @@ -13757,20 +13756,20 @@ "type": "github" } ], - "time": "2024-10-28T14:28:22+00:00" + "time": "2024-11-26T21:46:03+00:00" }, { "name": "staabm/phpstan-todo-by", - "version": "0.1.32", + "version": "0.2", "source": { "type": "git", "url": "https://github.com/staabm/phpstan-todo-by.git", - "reference": "81a55caa8af4451082c5688f9e69089275332d9a" + "reference": "de149a2dcdc0bcb5f3ebc6f6c571bf50d74aea92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/staabm/phpstan-todo-by/zipball/81a55caa8af4451082c5688f9e69089275332d9a", - "reference": "81a55caa8af4451082c5688f9e69089275332d9a", + "url": "https://api.github.com/repos/staabm/phpstan-todo-by/zipball/de149a2dcdc0bcb5f3ebc6f6c571bf50d74aea92", + "reference": "de149a2dcdc0bcb5f3ebc6f6c571bf50d74aea92", "shasum": "" }, "require": { @@ -13780,7 +13779,7 @@ "ext-json": "*", "nikolaposa/version": "^4.1", "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^1.10" + "phpstan/phpstan": "^1.10 || ^2.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.64", @@ -13817,7 +13816,7 @@ ], "support": { "issues": "https://github.com/staabm/phpstan-todo-by/issues", - "source": "https://github.com/staabm/phpstan-todo-by/tree/0.1.32" + "source": "https://github.com/staabm/phpstan-todo-by/tree/0.2" }, "funding": [ { @@ -13825,7 +13824,7 @@ "type": "github" } ], - "time": "2024-10-08T10:08:28+00:00" + "time": "2024-11-11T08:11:22+00:00" }, { "name": "symfony/browser-kit", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index b0a3f959f..410b1ff74 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,61 +1,73 @@ parameters: ignoreErrors: - - message: "#^Dead catch \\- Symfony\\\\Component\\\\Lock\\\\Exception\\\\LockReleasingException is never thrown in the try block\\.$#" + message: '#^Dead catch \- Symfony\\Component\\Lock\\Exception\\LockReleasingException is never thrown in the try block\.$#' + identifier: catch.neverThrown count: 1 path: src/Command/RunWorkersCommand.php - - message: "#^Parameter \\#1 \\$job of method App\\\\Service\\\\UpdaterWorker\\:\\:process\\(\\) expects App\\\\Entity\\\\Job\\, App\\\\Entity\\\\Job\\ given\\.$#" - count: 1 - path: src/DataFixtures/PackageFixtures.php - - - - message: "#^Query error\\: Column \"audit_log\\.attributes\" expects value type string, got type array\\$#" + message: '#^Query error\: Column "audit_log\.attributes" expects value type string, got type array\$#' + identifier: dba.keyValue count: 1 path: src/Entity/AuditRecordRepository.php - - message: "#^Query error\\: Column \"audit_log\\.datetime\" expects value type string, got type DateTimeImmutable$#" + message: '#^Query error\: Column "audit_log\.datetime" expects value type string, got type DateTimeImmutable$#' + identifier: dba.keyValue count: 1 path: src/Entity/AuditRecordRepository.php - - message: "#^Query error\\: Column \"audit_log\\.id\" expects value type string, got type Symfony\\\\Component\\\\Uid\\\\Ulid$#" + message: '#^Query error\: Column "audit_log\.id" expects value type string, got type Symfony\\Component\\Uid\\Ulid$#' + identifier: dba.keyValue count: 1 path: src/Entity/AuditRecordRepository.php - - message: "#^Method App\\\\Entity\\\\PackageRepository\\:\\:getDependents\\(\\) should return array\\ but returns array\\, non\\-empty\\-array\\\\>\\.$#" + message: '#^Query error\: Unknown column ''d\.total'' in ''order clause'' \(1054\)\.$#' + identifier: dba.syntaxError count: 1 path: src/Entity/PackageRepository.php - - message: "#^Method App\\\\Entity\\\\PackageRepository\\:\\:getSuggestCount\\(\\) should return int\\<0, max\\> but returns int\\.$#" + message: '#^Offset ''name'' on array\{name\: string, description\?\: string\} on left side of \?\? always exists and is not nullable\.$#' + identifier: nullCoalesce.offset + count: 2 + path: src/Entity/Version.php + + - + message: '#^Method App\\Model\\FavoriteManager\:\:getFavoriteCount\(\) should return int\<0, max\> but returns int\.$#' + identifier: return.type count: 1 - path: src/Entity/PackageRepository.php + path: src/Model/FavoriteManager.php - - message: "#^Query error\\: Unknown column 'd\\.total' in 'order clause' \\(1054\\)\\.$#" + message: '#^Parameter \#1 \$ids of method App\\Entity\\PackageRepository\:\:getPackagesWithVersions\(\) expects list\\|null, array\, int\> given\.$#' + identifier: argument.type count: 1 - path: src/Entity/PackageRepository.php + path: src/Package/SymlinkDumper.php - - message: "#^Offset 'name' on array\\{name\\: string, description\\?\\: string\\} on left side of \\?\\? always exists and is not nullable\\.$#" - count: 2 - path: src/Entity/Version.php + message: '#^Method App\\Package\\Updater\:\:sanitize\(\) should return T of string\|null but returns null\.$#' + identifier: return.type + count: 1 + path: src/Package/Updater.php - - message: "#^Method App\\\\Model\\\\FavoriteManager\\:\\:getFavoriteCount\\(\\) should return int\\<0, max\\> but returns int\\.$#" + message: '#^Method App\\Package\\Updater\:\:sanitize\(\) should return T of string\|null but returns string\.$#' + identifier: return.type count: 1 - path: src/Model/FavoriteManager.php + path: src/Package/Updater.php - - message: "#^Parameter \\#1 \\$job of method App\\\\Service\\\\GitHubUserMigrationWorker\\:\\:process\\(\\) expects App\\\\Entity\\\\Job\\\\|App\\\\Entity\\\\Job\\\\|App\\\\Entity\\\\Job\\, App\\\\Entity\\\\Job\\\\> given\\.$#" + message: '#^Parameter \#1 \$ids of method App\\Entity\\PackageRepository\:\:getPackagesWithVersions\(\) expects list\\|null, array\, int\> given\.$#' + identifier: argument.type count: 1 - path: src/Service/QueueWorker.php + path: src/Package/V2Dumper.php - - message: "#^Parameter \\#1 \\$result of method App\\\\Entity\\\\Job\\\\>\\:\\:complete\\(\\) expects array\\{status\\: 'completed'\\|'errored'\\|'failed'\\|'package_deleted'\\|'package_gone'\\|'queued'\\|'reschedule'\\|'started'\\|'timeout', message\\?\\: string, after\\?\\: DateTimeInterface&Throwable, details\\?\\: string, exception\\?\\: Throwable, exceptionMsg\\?\\: string, exceptionClass\\?\\: class\\-string\\, results\\?\\: array, \\.\\.\\.\\}, array\\{status\\: 'completed'\\|'errored'\\|'failed'\\|'package_deleted'\\|'package_gone', message\\: string, after\\?\\: DateTimeInterface, details\\?\\: string, exception\\?\\: Throwable, exceptionMsg\\?\\: string, exceptionClass\\?\\: class\\-string\\, results\\?\\: array, \\.\\.\\.\\} given\\.$#" + message: '#^Parameter \#1 \$job of method App\\Service\\GitHubUserMigrationWorker\:\:process\(\) expects App\\Entity\\Job\\|App\\Entity\\Job\\|App\\Entity\\Job\, App\\Entity\\Job\\> given\.$#' + identifier: argument.type count: 1 path: src/Service/QueueWorker.php diff --git a/phpstan.neon b/phpstan.neon index d83807c38..e1e3faec3 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -57,5 +57,16 @@ parameters: PackageUpdateJob: 'array{id: int, update_equal_refs: bool, delete_before: bool, force_dump: bool}' GitHubUserMigrateJob: 'array{id: int, old_scope: string, new_scope: string}' SecurityAdvisoryJob: 'array{source: string}' - # TODO maybe split those results per class as well instead of this cobbled up mess - JobResult: 'array{status: \App\Entity\Job::STATUS_*, message?: string, after?: \DateTimeInterface, details?: string, exception?: \Throwable, exceptionMsg?: string, exceptionClass?: class-string<\Throwable>, results?: array, vendor?: string}' + + JobResult: 'array{status: \App\Entity\Job::STATUS_*, message: string, vendor?: string, details?: string, exceptionMsg?: string, exceptionClass?: class-string<\Throwable>, results?: array{hooks_setup: int, hooks_failed: array, hooks_ok_unchanged: int}}' + ErroredResult: 'array{status: \App\Entity\Job::STATUS_ERRORED, message: string, exception: \Throwable}' + GenericCompletedResult: 'array{status: \App\Entity\Job::STATUS_COMPLETED, message: string}' + RescheduleResult: 'array{status: \App\Entity\Job::STATUS_RESCHEDULE, after: \DateTimeInterface, message: string, vendor?: string}' + PackageCompletedResult: 'array{status: \App\Entity\Job::STATUS_COMPLETED, message: string, details: string, vendor: string}' + PackageFailedResult: 'array{status: \App\Entity\Job::STATUS_FAILED, message: string, vendor: string, exception: \Throwable, details?: string}' + PackageGoneResult: 'array{status: \App\Entity\Job::STATUS_PACKAGE_GONE, message: string, vendor: string, exception: \Throwable, details?: string}' + PackageDeletedResult: 'array{status: \App\Entity\Job::STATUS_PACKAGE_DELETED, message: string, vendor: string, exception: \Throwable, details: string}' + AdvisoriesCompletedResult: 'array{status: \App\Entity\Job::STATUS_COMPLETED, message: string, details: string}' + AdvisoriesErroredResult: 'array{status: \App\Entity\Job::STATUS_ERRORED, message: string}' + GitHubMigrationResult: 'array{status: \App\Entity\Job::STATUS_COMPLETED, message: string, results: array{hooks_setup: int, hooks_failed: array, hooks_ok_unchanged: int}}' + GitHubMigrationFailedResult: 'array{status: \App\Entity\Job::STATUS_FAILED, message: string}' diff --git a/src/Controller/ExploreController.php b/src/Controller/ExploreController.php index 1bc461eed..682a76d63 100644 --- a/src/Controller/ExploreController.php +++ b/src/Controller/ExploreController.php @@ -111,7 +111,6 @@ public function popularAction(Request $req, RedisClient $redis, FavoriteManager 'total' => $packages->getNbResults(), ]; - /** @var Package $package */ foreach ($packages as $package) { $url = $this->generateUrl('view_package', ['name' => $package->getName()], UrlGeneratorInterface::ABSOLUTE_URL); diff --git a/src/Controller/PackageController.php b/src/Controller/PackageController.php index 5d57dd755..2b698b5e1 100644 --- a/src/Controller/PackageController.php +++ b/src/Controller/PackageController.php @@ -1571,6 +1571,9 @@ public function securityAdvisoryAction(Request $request, string $id): Response return $this->render('package/security_advisory.html.twig', ['securityAdvisories' => $securityAdvisories, 'id' => $id]); } + /** + * @return FormInterface + */ private function createAddMaintainerForm(Package $package): FormInterface { $maintainerRequest = new MaintainerRequest(); @@ -1578,6 +1581,9 @@ private function createAddMaintainerForm(Package $package): FormInterface return $this->createForm(AddMaintainerRequestType::class, $maintainerRequest); } + /** + * @return FormInterface + */ private function createRemoveMaintainerForm(Package $package): FormInterface { $maintainerRequest = new MaintainerRequest(); @@ -1587,6 +1593,9 @@ private function createRemoveMaintainerForm(Package $package): FormInterface ]); } + /** + * @return FormInterface + */ private function createDeletePackageForm(Package $package): FormInterface { return $this->createFormBuilder([])->getForm(); diff --git a/src/Controller/WebController.php b/src/Controller/WebController.php index 2162a2ec2..b04f79df7 100644 --- a/src/Controller/WebController.php +++ b/src/Controller/WebController.php @@ -68,7 +68,7 @@ public function searchApi(Request $req, Algolia $algolia): JsonResponse try { $query = new Query( $req->query->has('q') ? $req->query->getString('q') : $req->query->getString('query'), - (array) ($req->query->all()['tags'] ?? []), + array_values((array) ($req->query->all()['tags'] ?? [])), $req->query->getString('type', ''), $req->query->getInt('per_page', 15), $req->query->getInt('page', 1) @@ -177,9 +177,9 @@ public function statsAction(RedisClient $redis): Response 'versions' => !empty($chart['versions']) ? max($chart['versions']) : 0, 'downloads' => $downloads, 'downloadsChart' => $dlChart, - 'maxDailyDownloads' => !empty($dlChart) ? max($dlChart['values']) : null, + 'maxDailyDownloads' => !empty($dlChart) && \count($dlChart['values']) > 0 ? max($dlChart['values']) : null, 'downloadsChartMonthly' => $dlChartMonthly, - 'maxMonthlyDownloads' => !empty($dlChartMonthly) ? max($dlChartMonthly['values']) : null, + 'maxMonthlyDownloads' => !empty($dlChartMonthly) && \count($dlChartMonthly['values']) > 0 ? max($dlChartMonthly['values']) : null, 'downloadsStartDate' => $downloadsStartDate, ]); } diff --git a/src/Entity/DependentRepository.php b/src/Entity/DependentRepository.php index 085d7102d..9d36b6a57 100644 --- a/src/Entity/DependentRepository.php +++ b/src/Entity/DependentRepository.php @@ -16,10 +16,6 @@ use Doctrine\Persistence\ManagerRegistry; /** - * @method Dependent|null find($id, $lockMode = null, $lockVersion = null) - * @method Dependent|null findOneBy(array $criteria, array $orderBy = null) - * @method Dependent[] findAll() - * @method Dependent[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) * @extends ServiceEntityRepository */ class DependentRepository extends ServiceEntityRepository @@ -63,33 +59,4 @@ public function deletePackageDependentSuggesters(int $packageId): void $conn->executeStatement('DELETE FROM dependent WHERE package_id = :id', ['id' => $packageId]); $conn->executeStatement('DELETE FROM suggester WHERE package_id = :id', ['id' => $packageId]); } - - // /** - // * @return Dependent[] Returns an array of Dependent objects - // */ - /* - public function findByExampleField($value) - { - return $this->createQueryBuilder('d') - ->andWhere('d.exampleField = :val') - ->setParameter('val', $value) - ->orderBy('d.id', 'ASC') - ->setMaxResults(10) - ->getQuery() - ->getResult() - ; - } - */ - - /* - public function findOneBySomeField($value): ?Dependent - { - return $this->createQueryBuilder('d') - ->andWhere('d.exampleField = :val') - ->setParameter('val', $value) - ->getQuery() - ->getOneOrNullResult() - ; - } - */ } diff --git a/src/Entity/Job.php b/src/Entity/Job.php index 3b1a48ed5..71f303b18 100644 --- a/src/Entity/Job.php +++ b/src/Entity/Job.php @@ -60,7 +60,7 @@ class Job #[ORM\Column(type: 'string')] private string $status = self::STATUS_QUEUED; - /** @var (JobResult&array|\Throwable>)|null */ + /** @var JobResult|null */ #[ORM\Column(type: 'json', nullable: true)] private ?array $result = null; @@ -97,7 +97,7 @@ public function start(): void } /** - * @param JobResult&array|\Throwable> $result + * @param JobResult $result */ public function complete(array $result): void { @@ -158,7 +158,7 @@ public function getStatus(): string } /** - * @return JobResult&array|\Throwable> + * @return JobResult */ public function getResult(): ?array { diff --git a/src/Entity/PackageRepository.php b/src/Entity/PackageRepository.php index b5a1f9263..abe49f758 100644 --- a/src/Entity/PackageRepository.php +++ b/src/Entity/PackageRepository.php @@ -186,6 +186,7 @@ public function getPackagesWithFields(array $filters, array $fields): array } /** + * @param Query $query * @return list */ private function getPackageNamesForQuery(Query $query): array @@ -500,7 +501,7 @@ public function getDependentCount(string $name, ?int $type = null): int * @param string $name Package name to find the dependents of * @param int|null $type One of Dependent::TYPE_* * @param 'downloads'|'name' $orderBy - * @return array + * @return list */ public function getDependents(string $name, int $offset = 0, int $limit = 15, string $orderBy = 'name', ?int $type = null): array { @@ -526,6 +527,7 @@ public function getDependents(string $name, int $offset = 0, int $limit = 15, st ) x ON x.package_id = p.id '.$join.' ORDER BY '.$orderByField.' LIMIT '.((int) $limit).' OFFSET '.((int) $offset); $res = []; + /** @var array{id: int, name: string, description: string|null, language: string|null, abandoned: bool, replacementPackage: string|null} $row */ foreach ($this->getEntityManager()->getConnection()->fetchAllAssociative($sql, $args) as $row) { $res[] = ['id' => (int) $row['id'], 'abandoned' => (int) $row['abandoned']] + $row; } diff --git a/src/Entity/SuggesterRepository.php b/src/Entity/SuggesterRepository.php index 9fa6742d8..1f40c5d9d 100644 --- a/src/Entity/SuggesterRepository.php +++ b/src/Entity/SuggesterRepository.php @@ -16,10 +16,6 @@ use Doctrine\Persistence\ManagerRegistry; /** - * @method Suggester|null find($id, $lockMode = null, $lockVersion = null) - * @method Suggester|null findOneBy(array $criteria, array $orderBy = null) - * @method Suggester[] findAll() - * @method Suggester[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) * @extends ServiceEntityRepository */ class SuggesterRepository extends ServiceEntityRepository @@ -28,33 +24,4 @@ public function __construct(ManagerRegistry $registry) { parent::__construct($registry, Suggester::class); } - - // /** - // * @return Suggester[] Returns an array of Suggester objects - // */ - /* - public function findByExampleField($value) - { - return $this->createQueryBuilder('d') - ->andWhere('d.exampleField = :val') - ->setParameter('val', $value) - ->orderBy('d.id', 'ASC') - ->setMaxResults(10) - ->getQuery() - ->getResult() - ; - } - */ - - /* - public function findOneBySomeField($value): ?Suggester - { - return $this->createQueryBuilder('d') - ->andWhere('d.exampleField = :val') - ->setParameter('val', $value) - ->getQuery() - ->getOneOrNullResult() - ; - } - */ } diff --git a/src/Entity/User.php b/src/Entity/User.php index 0c836fc12..33af6b6e6 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -63,7 +63,7 @@ class User implements UserInterface, TwoFactorInterface, BackupCodeInterface, Eq private bool $enabled = false; /** - * @var list + * @var array */ #[ORM\Column(type: 'array')] private array $roles = []; diff --git a/src/Entity/Version.php b/src/Entity/Version.php index fab3273cc..74b790c0a 100644 --- a/src/Entity/Version.php +++ b/src/Entity/Version.php @@ -41,8 +41,8 @@ * autoload?: array, * extra?: array, * target-dir?: string, - * include-path?: list, - * bin?: list, + * include-path?: array, + * bin?: array, * default-branch?: true, * require?: array, * require-dev?: array, diff --git a/src/Form/ChangePasswordFormType.php b/src/Form/ChangePasswordFormType.php index 4686f6573..bba6e66d3 100644 --- a/src/Form/ChangePasswordFormType.php +++ b/src/Form/ChangePasswordFormType.php @@ -23,6 +23,9 @@ use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; use Symfony\Component\Validator\Constraints\NotBlank; +/** + * @extends AbstractType + */ class ChangePasswordFormType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void diff --git a/src/Form/RegistrationFormType.php b/src/Form/RegistrationFormType.php index 28e464334..e0e8690c3 100644 --- a/src/Form/RegistrationFormType.php +++ b/src/Form/RegistrationFormType.php @@ -24,6 +24,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Validator\Constraints\IsTrue; +/** + * @extends AbstractType + */ class RegistrationFormType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void diff --git a/src/Form/ResetPasswordFormType.php b/src/Form/ResetPasswordFormType.php index 112038d57..c4f59bdb4 100644 --- a/src/Form/ResetPasswordFormType.php +++ b/src/Form/ResetPasswordFormType.php @@ -24,6 +24,9 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; +/** + * @extends AbstractType + */ class ResetPasswordFormType extends AbstractType { public function configureOptions(OptionsResolver $resolver): void diff --git a/src/Form/ResetPasswordRequestFormType.php b/src/Form/ResetPasswordRequestFormType.php index 963298f82..39a27616f 100644 --- a/src/Form/ResetPasswordRequestFormType.php +++ b/src/Form/ResetPasswordRequestFormType.php @@ -19,6 +19,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Validator\Constraints\NotBlank; +/** + * @extends AbstractType + */ class ResetPasswordRequestFormType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void diff --git a/src/Form/Type/AbandonedType.php b/src/Form/Type/AbandonedType.php index be14eaa1a..369347768 100644 --- a/src/Form/Type/AbandonedType.php +++ b/src/Form/Type/AbandonedType.php @@ -20,6 +20,8 @@ * Class AbandonedType * * Form used to acquire replacement Package information for abandoned package. + * + * @extends AbstractType */ class AbandonedType extends AbstractType { diff --git a/src/Form/Type/AddMaintainerRequestType.php b/src/Form/Type/AddMaintainerRequestType.php index 2b651dbb3..53c9c8cf8 100644 --- a/src/Form/Type/AddMaintainerRequestType.php +++ b/src/Form/Type/AddMaintainerRequestType.php @@ -18,7 +18,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; /** - * @author Jordi Boggiano + * @extends AbstractType */ class AddMaintainerRequestType extends AbstractType { diff --git a/src/Form/Type/EnableTwoFactorAuthType.php b/src/Form/Type/EnableTwoFactorAuthType.php index c2b2f090d..9914e26eb 100644 --- a/src/Form/Type/EnableTwoFactorAuthType.php +++ b/src/Form/Type/EnableTwoFactorAuthType.php @@ -21,7 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; /** - * @author Igor Wiedler + * @extends AbstractType */ class EnableTwoFactorAuthType extends AbstractType { diff --git a/src/Form/Type/InvisibleRecaptchaType.php b/src/Form/Type/InvisibleRecaptchaType.php index 7341db649..b36222d2d 100644 --- a/src/Form/Type/InvisibleRecaptchaType.php +++ b/src/Form/Type/InvisibleRecaptchaType.php @@ -22,6 +22,8 @@ /** * InvisibleRecaptchaType enables recaptcha on the form after 3 wrong passwords are entered + * + * @extends AbstractType */ class InvisibleRecaptchaType extends AbstractType { diff --git a/src/Form/Type/PackageType.php b/src/Form/Type/PackageType.php index d060bed54..429d275ab 100644 --- a/src/Form/Type/PackageType.php +++ b/src/Form/Type/PackageType.php @@ -19,7 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; /** - * @author Jordi Boggiano + * @extends AbstractType */ class PackageType extends AbstractType { diff --git a/src/Form/Type/ProfileFormType.php b/src/Form/Type/ProfileFormType.php index 312d9a0f5..43d76401a 100644 --- a/src/Form/Type/ProfileFormType.php +++ b/src/Form/Type/ProfileFormType.php @@ -25,7 +25,7 @@ use Symfony\Component\Form\Extension\Core\Type\PasswordType; /** - * @author Jordi Boggiano + * @extends AbstractType */ class ProfileFormType extends AbstractType { diff --git a/src/Form/Type/RemoveMaintainerRequestType.php b/src/Form/Type/RemoveMaintainerRequestType.php index a6d8e7559..1e6c9d0c2 100644 --- a/src/Form/Type/RemoveMaintainerRequestType.php +++ b/src/Form/Type/RemoveMaintainerRequestType.php @@ -22,7 +22,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; /** - * @author Jordi Boggiano + * @extends AbstractType */ class RemoveMaintainerRequestType extends AbstractType { diff --git a/src/Package/SymlinkDumper.php b/src/Package/SymlinkDumper.php index 387365381..7cfa6730e 100644 --- a/src/Package/SymlinkDumper.php +++ b/src/Package/SymlinkDumper.php @@ -95,7 +95,7 @@ public function __construct( /** * Dump a set of packages to the web root * - * @param int[] $packageIds + * @param list $packageIds */ public function dump(array $packageIds, bool $force = false, bool $verbose = false, ?SignalHandler $signal = null): bool { diff --git a/src/Package/V2Dumper.php b/src/Package/V2Dumper.php index 6017a9513..982b16613 100644 --- a/src/Package/V2Dumper.php +++ b/src/Package/V2Dumper.php @@ -59,7 +59,7 @@ public function __construct( /** * Dump a set of packages to the web root * - * @param int[] $packageIds + * @param list $packageIds */ public function dump(array $packageIds, bool $force = false, bool $verbose = false): void { @@ -223,12 +223,8 @@ private function dumpPackageToV2File(string $dir, Package $package, array $versi $name = strtolower($package->getName()); $forceDump = $package->getDumpedAtV2() === null; - $versions = $package->getVersions(); - if (is_object($versions)) { - $versions = $versions->toArray(); - } - - usort($versions, Package::class.'::sortVersions'); + $versions = $package->getVersions()->toArray(); + usort($versions, Package::sortVersions(...)); $tags = []; $branches = []; diff --git a/src/Security/Provider/UserProvider.php b/src/Security/Provider/UserProvider.php index ec42e399e..1752e9246 100644 --- a/src/Security/Provider/UserProvider.php +++ b/src/Security/Provider/UserProvider.php @@ -23,7 +23,8 @@ use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; /** - * @template-implements UserProviderInterface + * @implements UserProviderInterface + * @implements PasswordUpgraderInterface */ class UserProvider implements UserProviderInterface, PasswordUpgraderInterface { diff --git a/src/Security/Voter/PackageVoter.php b/src/Security/Voter/PackageVoter.php index 42f730663..5b6614827 100644 --- a/src/Security/Voter/PackageVoter.php +++ b/src/Security/Voter/PackageVoter.php @@ -8,8 +8,12 @@ use Predis\Connection\ConnectionException; use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; +use Symfony\Component\Security\Core\Authorization\Voter\Voter; -class PackageVoter extends \Symfony\Component\Security\Core\Authorization\Voter\Voter +/** + * @extends Voter, Package> + */ +class PackageVoter extends Voter { public function __construct( private Security $security, diff --git a/src/Service/GitHubUserMigrationWorker.php b/src/Service/GitHubUserMigrationWorker.php index 510697b08..817dd7200 100644 --- a/src/Service/GitHubUserMigrationWorker.php +++ b/src/Service/GitHubUserMigrationWorker.php @@ -43,19 +43,7 @@ public function __construct( /** * @param Job $job - * @return array{ - * status: Job::STATUS_*, - * message: string, - * after?: \DateTime, - * results?: array{ - * hooks_setup: int, - * hooks_failed: array, - * hooks_ok_unchanged: int - * } - * } + * @return GenericCompletedResult|GitHubMigrationFailedResult|RescheduleResult|GitHubMigrationResult */ public function process(Job $job, SignalHandler $signal): array { @@ -73,7 +61,7 @@ public function process(Job $job, SignalHandler $signal): array if (null === $user->getGithubToken()) { $this->logger->info('User has no GitHub token setup, skipping', ['id' => $id]); - return ['status' => Job::STATUS_ERRORED, 'message' => 'User has no GitHub token setup, skipped']; + return ['status' => Job::STATUS_FAILED, 'message' => 'User has no GitHub token setup, skipped']; } try { diff --git a/src/Service/QueueWorker.php b/src/Service/QueueWorker.php index c70c73b7b..a0380e4c2 100644 --- a/src/Service/QueueWorker.php +++ b/src/Service/QueueWorker.php @@ -137,6 +137,7 @@ private function process(string $jobId, SignalHandler $signal): bool 'status' => 'type_errored', ]); } + /** @phpstan-var ErroredResult $result */ $result = [ 'status' => Job::STATUS_ERRORED, 'message' => 'An unexpected failure occurred', @@ -186,6 +187,7 @@ private function process(string $jobId, SignalHandler $signal): bool if (isset($result['exception'])) { $result['exceptionMsg'] = $result['exception']->getMessage(); $result['exceptionClass'] = get_class($result['exception']); + unset($result['exception']); } $job->complete($result); diff --git a/src/Service/SecurityAdvisoryWorker.php b/src/Service/SecurityAdvisoryWorker.php index bba9f85a7..1fa123823 100644 --- a/src/Service/SecurityAdvisoryWorker.php +++ b/src/Service/SecurityAdvisoryWorker.php @@ -44,7 +44,7 @@ public function __construct( /** * @param Job $job - * @return JobResult + * @return AdvisoriesCompletedResult|AdvisoriesErroredResult|RescheduleResult */ public function process(Job $job, SignalHandler $signal): array { @@ -52,7 +52,7 @@ public function process(Job $job, SignalHandler $signal): array $lockAcquired = $this->locker->lockSecurityAdvisory(self::ADVISORY_WORKER_RUN); if (!$lockAcquired) { - return ['status' => Job::STATUS_RESCHEDULE, 'after' => new \DateTime('+2 minutes')]; + return ['status' => Job::STATUS_RESCHEDULE, 'after' => new \DateTime('+2 minutes'), 'message' => 'Could not acquire lock']; } $io = new BufferIO('', OutputInterface::VERBOSITY_VERY_VERBOSE, new HtmlOutputFormatter(Factory::createAdditionalStyles())); diff --git a/src/Service/UpdaterWorker.php b/src/Service/UpdaterWorker.php index 4ac438bcd..4dba104cf 100644 --- a/src/Service/UpdaterWorker.php +++ b/src/Service/UpdaterWorker.php @@ -95,6 +95,7 @@ public function setLoadMinimalVersions(bool $loadMinimalVersions): void /** * @param Job $job + * @return PackageCompletedResult|PackageFailedResult|PackageGoneResult|RescheduleResult * @return array{status: Job::STATUS_*, message?: string, after?: \DateTimeInterface, vendor?: string, details?: string, exception?: \Throwable} */ public function process(Job $job, SignalHandler $signal): array @@ -114,7 +115,7 @@ public function process(Job $job, SignalHandler $signal): array $lockAcquired = $this->locker->lockPackageUpdate($id); if (!$lockAcquired) { - return ['status' => Job::STATUS_RESCHEDULE, 'after' => new \DateTime('+5 seconds'), 'vendor' => $packageVendor]; + return ['status' => Job::STATUS_RESCHEDULE, 'after' => new \DateTime('+5 seconds'), 'vendor' => $packageVendor, 'message' => 'Could not acquire lock']; } $this->logger->info('Updating '.$packageName); @@ -434,7 +435,7 @@ private function cleanupOutput(string $str): string } /** - * @return array{status: Job::STATUS_*, message: string, details: string, exception: TransportException, vendor: string}|null + * @return PackageGoneResult|PackageDeletedResult|null */ private function checkForDeadGitHubPackage(Package $package, string $repo, HttpDownloader $httpDownloader, string $output): ?array { @@ -459,7 +460,7 @@ private function checkForDeadGitHubPackage(Package $package, string $repo, HttpD } /** - * @return array{status: Job::STATUS_*, message: string, details: string, exception: TransportException, vendor: string}|null + * @return PackageGoneResult|PackageDeletedResult|null */ private function checkForDeadGitLabPackage(Package $package, string $repo, HttpDownloader $httpDownloader, string $output): ?array { @@ -481,7 +482,7 @@ private function checkForDeadGitLabPackage(Package $package, string $repo, HttpD } /** - * @return array{status: Job::STATUS_*, message: string, details: string, exception: TransportException, vendor: string}|null + * @return PackageGoneResult|PackageDeletedResult|null */ private function completeDeadPackageCheck(string $referenceRepoApiUrl, Package $package, HttpDownloader $httpDownloader, string $output, TransportException $e): ?array { diff --git a/src/Validator/Copyright.php b/src/Validator/Copyright.php index 44d3ff959..a7f187f50 100644 --- a/src/Validator/Copyright.php +++ b/src/Validator/Copyright.php @@ -18,7 +18,6 @@ #[Attribute(Attribute::TARGET_CLASS)] class Copyright extends Constraint { - /** @readonly */ public string $message = ''; public function getTargets(): string diff --git a/src/Validator/PopularPackageSafety.php b/src/Validator/PopularPackageSafety.php index 6ce0c1b6b..8e63d008e 100644 --- a/src/Validator/PopularPackageSafety.php +++ b/src/Validator/PopularPackageSafety.php @@ -18,7 +18,6 @@ #[Attribute(Attribute::TARGET_CLASS)] class PopularPackageSafety extends Constraint { - /** @readonly */ public string $message = 'This package is very popular and URL editing has been disabled for security reasons. Please add a note on the old repo pointing to the new one if possible then get in touch at contact@packagist.org so we can get it sorted.'; public function getTargets(): string diff --git a/src/Validator/TypoSquatters.php b/src/Validator/TypoSquatters.php index 24ab6d520..97a2cf611 100644 --- a/src/Validator/TypoSquatters.php +++ b/src/Validator/TypoSquatters.php @@ -18,7 +18,6 @@ #[Attribute(Attribute::TARGET_CLASS)] class TypoSquatters extends Constraint { - /** @readonly */ public string $message = 'Your package name "{{ name }}" is blocked as its name is too close to "{{ existing }}"'; public function getTargets(): string diff --git a/src/Validator/UniquePackage.php b/src/Validator/UniquePackage.php index 9a78208a4..f9a5047cc 100644 --- a/src/Validator/UniquePackage.php +++ b/src/Validator/UniquePackage.php @@ -18,7 +18,6 @@ #[Attribute(Attribute::TARGET_CLASS)] class UniquePackage extends Constraint { - /** @readonly */ public string $message = ''; public function getTargets(): string diff --git a/src/Validator/ValidPackageRepository.php b/src/Validator/ValidPackageRepository.php index 49b59a91a..eec5d821f 100644 --- a/src/Validator/ValidPackageRepository.php +++ b/src/Validator/ValidPackageRepository.php @@ -18,7 +18,6 @@ #[Attribute(Attribute::TARGET_CLASS)] class ValidPackageRepository extends Constraint { - /** @readonly */ public string $message = ''; public function getTargets(): string diff --git a/src/Validator/VendorWritable.php b/src/Validator/VendorWritable.php index fbcf93212..0b9c9fd85 100644 --- a/src/Validator/VendorWritable.php +++ b/src/Validator/VendorWritable.php @@ -18,7 +18,6 @@ #[Attribute(Attribute::TARGET_CLASS)] class VendorWritable extends Constraint { - /** @readonly */ public string $message = ''; public function getTargets(): string