diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index c014f30..0029ddd 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -70,6 +70,7 @@ jobs: php-version: - "8.2" - "8.3" + - "8.4" dependencies: - "highest" runs-on: ${{ matrix.operating-system }} diff --git a/composer.json b/composer.json index 449ae96..4f01d6c 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,7 @@ "php": ">=8.2", "phpdocumentor/reflection-docblock": "^5.3", "psr/log": "^1.0|^2.0|^3.0", + "symfony/asset": "^6.4|^7.0", "symfony/asset-mapper": "^6.4|^7.0", "symfony/config": "^6.4|^7.0", "symfony/dependency-injection": "^6.4|^7.0", @@ -48,23 +49,24 @@ "require-dev": { "ext-sockets": "*", "dbrekelmans/bdi": "^1.1", - "ekino/phpstan-banned-code": "^1.0 || ^2.0", + "ekino/phpstan-banned-code": "^1.0|^2.0|^3.0", "ergebnis/phpunit-slow-test-detector": "^2.14", - "infection/infection": "^0.28 || ^0.29", + "infection/infection": "^0.28|^0.29", "matthiasnoback/symfony-config-test": "^5.1", + "nelmio/security-bundle": "^3.0", "php-parallel-lint/php-parallel-lint": "^1.4", "phpstan/extension-installer": "^1.1", - "phpstan/phpdoc-parser": "^1.28", - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-beberlei-assert": "^1.0", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.3", - "phpstan/phpstan-strict-rules": "^1.0", - "phpstan/phpstan-symfony": "^1.3", + "phpstan/phpdoc-parser": "^1.28|^2.0", + "phpstan/phpstan": "^1.0|^2.0", + "phpstan/phpstan-beberlei-assert": "^1.0|^2.0", + "phpstan/phpstan-deprecation-rules": "^1.0|^2.0", + "phpstan/phpstan-phpunit": "^1.4|^2.0", + "phpstan/phpstan-strict-rules": "^1.0|^2.0", + "phpstan/phpstan-symfony": "^1.4|^2.0", "phpunit/phpunit": "^10.1|^11.0", - "rector/rector": "^1.0", - "staabm/phpstan-todo-by": "^0.1.25", - "struggle-for-php/sfp-phpstan-psr-log": "^0.20.0 || ^0.21.0 || ^0.22.0", + "rector/rector": "^1.0|^2.0", + "staabm/phpstan-todo-by": "^0.1.27|^0.2", + "struggle-for-php/sfp-phpstan-psr-log": "^0.21.0|^0.22|^0.23", "symfony/filesystem": "^6.4|^7.0", "symfony/framework-bundle": "^6.4|^7.0", "symfony/mime": "^6.4|^7.0", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 14f7bdc..9bb10b8 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,691 +1,1417 @@ parameters: ignoreErrors: - - message: "#^Only iterables can be unpacked, mixed given in argument \\#1\\.$#" + message: '#^Only iterables can be unpacked, mixed given in argument \#1\.$#' + identifier: argument.unpackNonIterable count: 1 path: src/CachingStrategy/AssetCache.php - - message: "#^Parameter \\#1 \\$name of method SpomkyLabs\\\\PwaBundle\\\\CachingStrategy\\\\WorkboxCacheStrategy\\:\\:withName\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$name of method SpomkyLabs\\PwaBundle\\CachingStrategy\\WorkboxCacheStrategy\:\:withName\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CachingStrategy/AssetCache.php - - message: "#^Parameter \\#1 \\$preloadUrl of method SpomkyLabs\\\\PwaBundle\\\\CachingStrategy\\\\WorkboxCacheStrategy\\:\\:withPreloadUrl\\(\\) expects string, mixed given\\.$#" + message: '#^Parameter \#1 \$preloadUrl of method SpomkyLabs\\PwaBundle\\CachingStrategy\\WorkboxCacheStrategy\:\:withPreloadUrl\(\) expects string, mixed given\.$#' + identifier: argument.type count: 1 path: src/CachingStrategy/AssetCache.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, mixed given\.$#' + identifier: argument.type count: 1 path: src/CachingStrategy/AssetCache.php - - message: "#^Attribute class Symfony\\\\Component\\\\DependencyInjection\\\\Attribute\\\\TaggedIterator is deprecated\\: since Symfony 7\\.1, use \\{@see AutowireIterator\\} instead\\.$#" - count: 1 - path: src/CachingStrategy/BackgroundSync.php - - - - message: "#^Only iterables can be unpacked, mixed given in argument \\#1\\.$#" + message: '#^Only iterables can be unpacked, mixed given in argument \#1\.$#' + identifier: argument.unpackNonIterable count: 1 path: src/CachingStrategy/FontCache.php - - message: "#^Parameter \\#1 \\$preloadUrl of method SpomkyLabs\\\\PwaBundle\\\\CachingStrategy\\\\WorkboxCacheStrategy\\:\\:withPreloadUrl\\(\\) expects string, mixed given\\.$#" + message: '#^Parameter \#1 \$preloadUrl of method SpomkyLabs\\PwaBundle\\CachingStrategy\\WorkboxCacheStrategy\:\:withPreloadUrl\(\) expects string, mixed given\.$#' + identifier: argument.type count: 1 path: src/CachingStrategy/FontCache.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, mixed given\.$#' + identifier: argument.type count: 2 path: src/CachingStrategy/FontCache.php - - message: "#^Attribute class Symfony\\\\Component\\\\DependencyInjection\\\\Attribute\\\\TaggedIterator is deprecated\\: since Symfony 7\\.1, use \\{@see AutowireIterator\\} instead\\.$#" - count: 1 - path: src/CachingStrategy/PreloadUrlsGeneratorManager.php - - - - message: "#^Attribute class Symfony\\\\Component\\\\DependencyInjection\\\\Attribute\\\\TaggedIterator is deprecated\\: since Symfony 7\\.1, use \\{@see AutowireIterator\\} instead\\.$#" + message: '#^Only iterables can be unpacked, mixed given in argument \#1\.$#' + identifier: argument.unpackNonIterable count: 1 path: src/CachingStrategy/ResourceCaches.php - - message: "#^Only iterables can be unpacked, mixed given in argument \\#1\\.$#" + message: '#^Parameter \#1 \$headersToCheck of static method SpomkyLabs\\PwaBundle\\WorkboxPlugin\\BroadcastUpdatePlugin\:\:create\(\) expects array\, array\ given\.$#' + identifier: argument.type count: 1 path: src/CachingStrategy/ResourceCaches.php - - message: "#^Parameter \\#1 \\$preloadUrl of method SpomkyLabs\\\\PwaBundle\\\\CachingStrategy\\\\WorkboxCacheStrategy\\:\\:withPreloadUrl\\(\\) expects string, mixed given\\.$#" + message: '#^Parameter \#1 \$preloadUrl of method SpomkyLabs\\PwaBundle\\CachingStrategy\\WorkboxCacheStrategy\:\:withPreloadUrl\(\) expects string, mixed given\.$#' + identifier: argument.type count: 1 path: src/CachingStrategy/ResourceCaches.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, mixed given\.$#' + identifier: argument.type count: 1 path: src/CachingStrategy/ResourceCaches.php - - message: "#^Part \\$this\\-\\>options\\['networkTimeoutSeconds'\\] \\(mixed\\) of encapsed string cannot be cast to string\\.$#" + message: '#^Part \$this\-\>options\[''networkTimeoutSeconds''\] \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: src/CachingStrategy/WorkboxCacheStrategy.php - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" + message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#' + identifier: foreach.nonIterable count: 1 path: src/Command/CreateIconsCommand.php - - message: "#^Cannot cast mixed to int\\.$#" + message: '#^Cannot cast mixed to int\.$#' + identifier: cast.int count: 1 path: src/Command/CreateIconsCommand.php - - message: "#^Cannot cast mixed to string\\.$#" + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string count: 1 path: src/Command/CreateIconsCommand.php - - message: "#^Parameter \\#1 \\$image of method SpomkyLabs\\\\PwaBundle\\\\ImageProcessor\\\\ImageProcessorInterface\\:\\:process\\(\\) expects string, string\\|false given\\.$#" + message: '#^Parameter \#1 \$image of method SpomkyLabs\\PwaBundle\\ImageProcessor\\ImageProcessorInterface\:\:process\(\) expects string, string\|false given\.$#' + identifier: argument.type count: 1 path: src/Command/CreateIconsCommand.php - - message: "#^Parameter \\#1 \\$source of method SpomkyLabs\\\\PwaBundle\\\\Command\\\\CreateIconsCommand\\:\\:getSourcePath\\(\\) expects string, mixed given\\.$#" + message: '#^Parameter \#1 \$source of method SpomkyLabs\\PwaBundle\\Command\\CreateIconsCommand\:\:getSourcePath\(\) expects string, mixed given\.$#' + identifier: argument.type count: 1 path: src/Command/CreateIconsCommand.php - - message: "#^Parameter \\#3 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" + message: '#^Parameter \#3 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#' + identifier: argument.type count: 1 path: src/Command/CreateIconsCommand.php - - message: "#^Cannot cast mixed to int\\.$#" + message: '#^Cannot cast mixed to int\.$#' + identifier: cast.int count: 2 path: src/Command/CreateScreenshotCommand.php - - message: "#^Cannot cast mixed to string\\.$#" + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string count: 2 path: src/Command/CreateScreenshotCommand.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Command\\\\CreateScreenshotCommand\\:\\:getDefaultArguments\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Command\\CreateScreenshotCommand\:\:getAvailablePort\(\) should return int but returns mixed\.$#' + identifier: return.type count: 1 path: src/Command/CreateScreenshotCommand.php - - message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Command\\CreateScreenshotCommand\:\:getDefaultArguments\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Command/CreateScreenshotCommand.php - - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + message: '#^Only booleans are allowed in a negated boolean, mixed given\.$#' + identifier: booleanNot.exprNotBoolean + count: 1 + path: src/Command/CreateScreenshotCommand.php + + - + message: '#^Only booleans are allowed in an if condition, mixed given\.$#' + identifier: if.condNotBoolean count: 3 path: src/Command/CreateScreenshotCommand.php - - message: "#^Parameter \\#2 \\$uri of method Symfony\\\\Component\\\\Panther\\\\Client\\:\\:request\\(\\) expects string, mixed given\\.$#" + message: '#^Parameter \#2 \$uri of method Symfony\\Component\\Panther\\Client\:\:request\(\) expects string, mixed given\.$#' + identifier: argument.type count: 1 path: src/Command/CreateScreenshotCommand.php - - message: "#^Parameter \\#3 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" + message: '#^Parameter \#3 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#' + identifier: argument.type count: 1 path: src/Command/CreateScreenshotCommand.php - - message: "#^Attribute class Symfony\\\\Component\\\\DependencyInjection\\\\Attribute\\\\TaggedIterator is deprecated\\: since Symfony 7\\.1, use \\{@see AutowireIterator\\} instead\\.$#" + message: '#^Parameter \$arguments of static method Symfony\\Component\\Panther\\Client\:\:createChromeClient\(\) expects array\\|null, array given\.$#' + identifier: argument.type + count: 1 + path: src/Command/CreateScreenshotCommand.php + + - + message: '#^Cannot access offset ''data'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 4 + path: src/DataCollector/PwaCollector.php + + - + message: '#^Cannot access offset ''files'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 3 + path: src/DataCollector/PwaCollector.php + + - + message: '#^Cannot access property \$workbox on mixed\.$#' + identifier: property.nonObject + count: 1 + path: src/DataCollector/PwaCollector.php + + - + message: '#^Method SpomkyLabs\\PwaBundle\\DataCollector\\PwaCollector\:\:getCachingStrategies\(\) should return array\ but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/DataCollector/PwaCollector.php + + - + message: '#^Method SpomkyLabs\\PwaBundle\\DataCollector\\PwaCollector\:\:getData\(\) should return array\\|Symfony\\Component\\VarDumper\\Cloner\\Data but returns array\|Symfony\\Component\\VarDumper\\Cloner\\Data\.$#' + identifier: return.type + count: 1 + path: src/DataCollector/PwaCollector.php + + - + message: '#^Method SpomkyLabs\\PwaBundle\\DataCollector\\PwaCollector\:\:getFavicons\(\) should return SpomkyLabs\\PwaBundle\\Dto\\Favicons but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/DataCollector/PwaCollector.php + + - + message: '#^Method SpomkyLabs\\PwaBundle\\DataCollector\\PwaCollector\:\:getFaviconsFiles\(\) should return array\ but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/DataCollector/PwaCollector.php + + - + message: '#^Method SpomkyLabs\\PwaBundle\\DataCollector\\PwaCollector\:\:getManifest\(\) should return SpomkyLabs\\PwaBundle\\Dto\\Manifest but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/DataCollector/PwaCollector.php + + - + message: '#^Method SpomkyLabs\\PwaBundle\\DataCollector\\PwaCollector\:\:getManifestFiles\(\) should return array\ but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/DataCollector/PwaCollector.php + + - + message: '#^Method SpomkyLabs\\PwaBundle\\DataCollector\\PwaCollector\:\:getServiceWorker\(\) should return SpomkyLabs\\PwaBundle\\Dto\\ServiceWorker but returns mixed\.$#' + identifier: return.type count: 1 - path: src/Command/ListCacheStrategiesCommand.php + path: src/DataCollector/PwaCollector.php - - message: "#^Attribute class Symfony\\\\Component\\\\DependencyInjection\\\\Attribute\\\\TaggedIterator is deprecated\\: since Symfony 7\\.1, use \\{@see AutowireIterator\\} instead\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\DataCollector\\PwaCollector\:\:getServiceWorkerFiles\(\) should return array\ but returns mixed\.$#' + identifier: return.type count: 1 path: src/DataCollector/PwaCollector.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\BackgroundSync has an uninitialized property \\$forceSyncFallback\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\DataCollector\\PwaCollector\:\:getWorkbox\(\) should return SpomkyLabs\\PwaBundle\\Dto\\Workbox but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/DataCollector/PwaCollector.php + + - + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\BackgroundSync has an uninitialized property \$forceSyncFallback\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/BackgroundSync.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\BackgroundSync has an uninitialized property \\$matchCallback\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\BackgroundSync has an uninitialized property \$matchCallback\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/BackgroundSync.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\BackgroundSync has an uninitialized property \\$maxRetentionTime\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\BackgroundSync has an uninitialized property \$maxRetentionTime\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/BackgroundSync.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\BackgroundSync has an uninitialized property \\$method\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\BackgroundSync has an uninitialized property \$method\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/BackgroundSync.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\BackgroundSync has an uninitialized property \\$queueName\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\BackgroundSync has an uninitialized property \$queueName\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/BackgroundSync.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Favicons has an uninitialized property \\$src\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Favicons has an uninitialized property \$src\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Favicons.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\File has an uninitialized property \\$accept\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\File has an uninitialized property \$accept\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/File.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\File has an uninitialized property \\$name\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\File has an uninitialized property \$name\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/File.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\FileHandler has an uninitialized property \\$accept\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\FileHandler has an uninitialized property \$accept\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/FileHandler.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\FileHandler has an uninitialized property \\$action\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\FileHandler has an uninitialized property \$action\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/FileHandler.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\GoogleFontCache has an uninitialized property \\$enabled\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\GoogleFontCache has an uninitialized property \$enabled\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/GoogleFontCache.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Icon has an uninitialized property \\$sizeList\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Icon has an uninitialized property \$sizeList\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Icon.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Icon has an uninitialized property \\$src\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Icon has an uninitialized property \$src\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Icon.php - - message: "#^Property SpomkyLabs\\\\PwaBundle\\\\Dto\\\\LaunchHandler\\:\\:\\$clientMode type has no value type specified in iterable type array\\.$#" + message: '#^Property SpomkyLabs\\PwaBundle\\Dto\\LaunchHandler\:\:\$clientMode type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Dto/LaunchHandler.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Manifest\\:\\:getCategories\\(\\) should return array\\ but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\Manifest\:\:getCategories\(\) should return array\ but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/Manifest.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Manifest\\:\\:getDescription\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\Manifest\:\:getDescription\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/Manifest.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Manifest\\:\\:getName\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\Manifest\:\:getName\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/Manifest.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Manifest\\:\\:getShortName\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\Manifest\:\:getShortName\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/Manifest.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Manifest\\:\\:getStartUrl\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\Manifest\:\:getStartUrl\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/Manifest.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\PageCache extends @final class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\ResourceCache\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\PageCache extends @final class SpomkyLabs\\PwaBundle\\Dto\\ResourceCache\.$#' + identifier: class.extendsFinalByPhpDoc count: 1 path: src/Dto/PageCache.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\ProtocolHandler has an uninitialized property \\$protocol\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\ProtocolHandler has an uninitialized property \$protocol\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/ProtocolHandler.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\ProtocolHandler has an uninitialized property \\$url\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\ProtocolHandler has an uninitialized property \$url\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/ProtocolHandler.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\RelatedApplication has an uninitialized property \\$platform\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\RelatedApplication has an uninitialized property \$platform\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/RelatedApplication.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\RelatedApplication has an uninitialized property \\$url\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\RelatedApplication has an uninitialized property \$url\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/RelatedApplication.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\ResourceCache has an uninitialized property \\$matchCallback\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\ResourceCache has an uninitialized property \$matchCallback\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/ResourceCache.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\ScopeExtension has an uninitialized property \\$origin\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\ScopeExtension has an uninitialized property \$origin\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/ScopeExtension.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Screenshot has an uninitialized property \\$src\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Screenshot has an uninitialized property \$src\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Screenshot.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Screenshot\\:\\:getLabel\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\Screenshot\:\:getLabel\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/Screenshot.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\ServiceWorker has an uninitialized property \\$dest\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\ServiceWorker has an uninitialized property \$dest\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/ServiceWorker.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\ServiceWorker has an uninitialized property \\$enabled\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\ServiceWorker has an uninitialized property \$enabled\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/ServiceWorker.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\ServiceWorker has an uninitialized property \\$workbox\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\ServiceWorker has an uninitialized property \$workbox\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/ServiceWorker.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\ShareTarget has an uninitialized property \\$action\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\ShareTarget has an uninitialized property \$action\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/ShareTarget.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\ShareTargetParameters\\:\\:getText\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\ShareTargetParameters\:\:getText\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/ShareTargetParameters.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\ShareTargetParameters\\:\\:getTitle\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\ShareTargetParameters\:\:getTitle\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/ShareTargetParameters.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Shortcut has an uninitialized property \\$name\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Shortcut has an uninitialized property \$name\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Shortcut.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Shortcut has an uninitialized property \\$url\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Shortcut has an uninitialized property \$url\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Shortcut.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Shortcut\\:\\:getDescription\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\Shortcut\:\:getDescription\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/Shortcut.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Shortcut\\:\\:getName\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\Shortcut\:\:getName\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/Shortcut.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Shortcut\\:\\:getShortName\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\Shortcut\:\:getShortName\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/Shortcut.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Url has an uninitialized property \\$path\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Url has an uninitialized property \$path\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Url.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Widget has an uninitialized property \\$adaptativeCardTemplate\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Widget has an uninitialized property \$adaptativeCardTemplate\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Widget.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Widget has an uninitialized property \\$name\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Widget has an uninitialized property \$name\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Widget.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Widget\\:\\:getDescription\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\Widget\:\:getDescription\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/Widget.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Widget\\:\\:getName\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\Widget\:\:getName\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/Widget.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Widget\\:\\:getShortName\\(\\) should return string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null but returns array\\\\|string\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatableInterface\\|null\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Dto\\Widget\:\:getShortName\(\) should return string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null but returns array\\|string\|Symfony\\Contracts\\Translation\\TranslatableInterface\|null\.$#' + identifier: return.type count: 1 path: src/Dto/Widget.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Workbox has an uninitialized property \\$assetCache\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Workbox has an uninitialized property \$assetCache\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Workbox.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Workbox has an uninitialized property \\$cacheManifest\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Workbox has an uninitialized property \$cacheManifest\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Workbox.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Workbox has an uninitialized property \\$enabled\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Workbox has an uninitialized property \$enabled\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Workbox.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Workbox has an uninitialized property \\$fontCache\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Workbox has an uninitialized property \$fontCache\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Workbox.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Workbox has an uninitialized property \\$googleFontCache\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Workbox has an uninitialized property \$googleFontCache\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Workbox.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Workbox has an uninitialized property \\$imageCache\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Workbox has an uninitialized property \$imageCache\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Workbox.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Workbox has an uninitialized property \\$offlineFallback\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Workbox has an uninitialized property \$offlineFallback\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Workbox.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Workbox has an uninitialized property \\$resourceCaches\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Workbox has an uninitialized property \$resourceCaches\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Workbox.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Workbox has an uninitialized property \\$useCDN\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Workbox has an uninitialized property \$useCDN\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Workbox.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Workbox has an uninitialized property \\$version\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Workbox has an uninitialized property \$version\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Workbox.php - - message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Workbox has an uninitialized property \\$workboxPublicUrl\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class SpomkyLabs\\PwaBundle\\Dto\\Workbox has an uninitialized property \$workboxPublicUrl\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Dto/Workbox.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\ImageProcessor\\\\GDImageProcessor\\:\\:process\\(\\) should return string but returns string\\|false\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\ImageProcessor\\GDImageProcessor\:\:process\(\) should return string but returns string\|false\.$#' + identifier: return.type count: 1 path: src/ImageProcessor/GDImageProcessor.php - - message: "#^Parameter \\#1 \\$width of function imagecreatetruecolor expects int\\<1, max\\>, int given\\.$#" + message: '#^Parameter \#1 \$width of function imagecreatetruecolor expects int\<1, max\>, int given\.$#' + identifier: argument.type count: 2 path: src/ImageProcessor/GDImageProcessor.php - - message: "#^Parameter \\#2 \\$height of function imagecreatetruecolor expects int\\<1, max\\>, int given\\.$#" + message: '#^Parameter \#2 \$height of function imagecreatetruecolor expects int\<1, max\>, int given\.$#' + identifier: argument.type count: 2 path: src/ImageProcessor/GDImageProcessor.php - - message: "#^Parameter \\#2 \\$red of function imagecolorallocate expects int\\<0, 255\\>, int given\\.$#" + message: '#^Parameter \#2 \$red of function imagecolorallocate expects int\<0, 255\>, int given\.$#' + identifier: argument.type count: 1 path: src/ImageProcessor/GDImageProcessor.php - - message: "#^Parameter \\#3 \\$green of function imagecolorallocate expects int\\<0, 255\\>, int given\\.$#" + message: '#^Parameter \#3 \$green of function imagecolorallocate expects int\<0, 255\>, int given\.$#' + identifier: argument.type count: 1 path: src/ImageProcessor/GDImageProcessor.php - - message: "#^Parameter \\#4 \\$blue of function imagecolorallocate expects int\\<0, 255\\>, int given\\.$#" + message: '#^Parameter \#4 \$blue of function imagecolorallocate expects int\<0, 255\>, int given\.$#' + identifier: argument.type count: 1 path: src/ImageProcessor/GDImageProcessor.php - - message: "#^PHPDoc tag @return with type array\\ is incompatible with native type string\\.$#" + message: '#^PHPDoc tag @return with type array\ is incompatible with native type string\.$#' + identifier: return.phpDocType count: 1 path: src/Normalizer/AssetNormalizer.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Normalizer\\\\IconNormalizer\\:\\:normalize\\(\\) should return array\\{src\\: string, sizes\\?\\: string, type\\?\\: string, purpose\\?\\: string\\} but returns array\\\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Normalizer\\IconNormalizer\:\:normalize\(\) should return array\{src\: string, sizes\?\: string, type\?\: string, purpose\?\: string\} but returns array\\.$#' + identifier: return.type count: 1 path: src/Normalizer/IconNormalizer.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Normalizer\\\\ScreenshotNormalizer\\:\\:normalize\\(\\) should return array\\{src\\: string, sizes\\?\\: string, form_factor\\?\\: string, label\\?\\: string, platform\\?\\: string, format\\?\\: string\\} but returns array\\\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Normalizer\\ScreenshotNormalizer\:\:normalize\(\) should return array\{src\: string, sizes\?\: string, form_factor\?\: string, label\?\: string, platform\?\: string, format\?\: string\} but returns array\\.$#' + identifier: return.type count: 1 path: src/Normalizer/ScreenshotNormalizer.php - - message: "#^Parameter \\#1 \\$image of method SpomkyLabs\\\\PwaBundle\\\\ImageProcessor\\\\ImageProcessorInterface\\:\\:getSizes\\(\\) expects string, string\\|false given\\.$#" + message: '#^Parameter \#1 \$image of method SpomkyLabs\\PwaBundle\\ImageProcessor\\ImageProcessorInterface\:\:getSizes\(\) expects string, string\|false given\.$#' + identifier: argument.type count: 1 path: src/Normalizer/ScreenshotNormalizer.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Normalizer\\\\ServiceWorkerNormalizer\\:\\:normalize\\(\\) should return array\\{scope\\?\\: string, src\\: string, use_cache\\?\\: bool\\} but returns array\\\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Normalizer\\ServiceWorkerNormalizer\:\:normalize\(\) should return array\{scope\?\: string, src\: string, use_cache\?\: bool\} but returns array\\.$#' + identifier: return.type count: 1 path: src/Normalizer/ServiceWorkerNormalizer.php - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method arrayNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method booleanNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method canBeEnabled\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method children\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method defaultFalse\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method defaultNull\(\) on mixed\.$#' + identifier: method.nonObject + count: 6 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method defaultValue\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method end\(\) on mixed\.$#' + identifier: method.nonObject + count: 13 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method example\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method info\(\) on mixed\.$#' + identifier: method.nonObject + count: 9 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method integerNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method isRequired\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: src/Resources/config/definition/favicons.php - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + message: '#^Cannot call method max\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method min\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Cannot call method scalarNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 5 + path: src/Resources/config/definition/favicons.php + + - + message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#' + identifier: method.notFound count: 1 path: src/Resources/config/definition/image_processor.php - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + message: '#^Cannot call method defaultNull\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/image_processor.php + + - + message: '#^Cannot call method end\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/image_processor.php + + - + message: '#^Cannot call method example\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/image_processor.php + + - + message: '#^Cannot call method info\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/image_processor.php + + - + message: '#^Cannot call method scalarNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/image_processor.php + + - + message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/Resources/config/definition/logging.php + + - + message: '#^Cannot call method defaultNull\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/logging.php + + - + message: '#^Cannot call method end\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/logging.php + + - + message: '#^Cannot call method info\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/logging.php + + - + message: '#^Cannot call method scalarNode\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: src/Resources/config/definition/logging.php - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method append\(\) on mixed\.$#' + identifier: method.nonObject + count: 9 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method arrayNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 5 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method arrayPrototype\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: src/Resources/config/definition/manifest.php - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + message: '#^Cannot call method booleanNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method canBeEnabled\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method cannotBeEmpty\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method children\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method defaultTrue\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method defaultValue\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method end\(\) on mixed\.$#' + identifier: method.nonObject + count: 32 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method example\(\) on mixed\.$#' + identifier: method.nonObject + count: 18 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method info\(\) on mixed\.$#' + identifier: method.nonObject + count: 24 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method integerNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method isRequired\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method scalarNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 17 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Cannot call method scalarPrototype\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/manifest.php + + - + message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/Resources/config/definition/path_type_reference.php + + - + message: '#^Cannot call method defaultValue\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: src/Resources/config/definition/path_type_reference.php - - message: "#^Anonymous function should return array but returns mixed\\.$#" + message: '#^Cannot call method end\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/path_type_reference.php + + - + message: '#^Cannot call method example\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/path_type_reference.php + + - + message: '#^Cannot call method ifNotInArray\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/path_type_reference.php + + - + message: '#^Cannot call method info\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/path_type_reference.php + + - + message: '#^Cannot call method integerNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/path_type_reference.php + + - + message: '#^Cannot call method setDeprecated\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/path_type_reference.php + + - + message: '#^Cannot call method thenInvalid\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/path_type_reference.php + + - + message: '#^Cannot call method validate\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/path_type_reference.php + + - + message: '#^Anonymous function should return array but returns mixed\.$#' + identifier: return.type count: 8 path: src/Resources/config/definition/service_worker.php - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#' + identifier: method.notFound count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access an offset on mixed\\.$#" + message: '#^Cannot access an offset on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'asset_cache' on mixed\\.$#" + message: '#^Cannot access offset ''asset_cache'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 2 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'asset_cache_name' on mixed\\.$#" + message: '#^Cannot access offset ''asset_cache_name'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'font_cache' on mixed\\.$#" + message: '#^Cannot access offset ''font_cache'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 2 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'font_cache_name' on mixed\\.$#" + message: '#^Cannot access offset ''font_cache_name'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'font_regex' on mixed\\.$#" + message: '#^Cannot access offset ''font_regex'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'image_cache' on mixed\\.$#" + message: '#^Cannot access offset ''image_cache'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 2 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'image_cache_name' on mixed\\.$#" + message: '#^Cannot access offset ''image_cache_name'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'image_regex' on mixed\\.$#" + message: '#^Cannot access offset ''image_regex'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'max_font_age' on mixed\\.$#" + message: '#^Cannot access offset ''max_font_age'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'max_font_cache…' on mixed\\.$#" + message: '#^Cannot access offset ''max_font_cache_entries'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'max_image_age' on mixed\\.$#" + message: '#^Cannot access offset ''max_image_age'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'max_image_cache…' on mixed\\.$#" + message: '#^Cannot access offset ''max_image_cache_entries'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'network_timeout…' on mixed\\.$#" + message: '#^Cannot access offset ''network_timeout_seconds'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'page_cache_name' on mixed\\.$#" + message: '#^Cannot access offset ''page_cache_name'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'resource_caches' on mixed\\.$#" + message: '#^Cannot access offset ''resource_caches'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 2 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'static_regex' on mixed\\.$#" + message: '#^Cannot access offset ''static_regex'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot access offset ''warm_cache_urls'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method addDefaultsIfNotSet\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Cannot access offset 'warm_cache_urls' on mixed\\.$#" + message: '#^Cannot call method append\(\) on mixed\.$#' + identifier: method.nonObject + count: 6 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method arrayNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 17 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method arrayPrototype\(\) on mixed\.$#' + identifier: method.nonObject + count: 4 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method beforeNormalization\(\) on mixed\.$#' + identifier: method.nonObject + count: 7 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method booleanNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 11 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method canBeDisabled\(\) on mixed\.$#' + identifier: method.nonObject + count: 5 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method canBeEnabled\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: src/Resources/config/definition/service_worker.php - - message: "#^Strict comparison using \\!\\=\\= between mixed and null will always evaluate to true\\.$#" + message: '#^Cannot call method cannotBeEmpty\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method children\(\) on mixed\.$#' + identifier: method.nonObject + count: 11 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method defaultFalse\(\) on mixed\.$#' + identifier: method.nonObject + count: 6 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method defaultNull\(\) on mixed\.$#' + identifier: method.nonObject + count: 6 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method defaultTrue\(\) on mixed\.$#' + identifier: method.nonObject + count: 5 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method defaultValue\(\) on mixed\.$#' + identifier: method.nonObject + count: 36 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method end\(\) on mixed\.$#' + identifier: method.nonObject + count: 107 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method example\(\) on mixed\.$#' + identifier: method.nonObject + count: 33 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method ifNotInArray\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method ifString\(\) on mixed\.$#' + identifier: method.nonObject count: 3 path: src/Resources/config/definition/service_worker.php - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + message: '#^Cannot call method ifTrue\(\) on mixed\.$#' + identifier: method.nonObject + count: 4 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method info\(\) on mixed\.$#' + identifier: method.nonObject + count: 68 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method integerNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 11 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method integerPrototype\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method isRequired\(\) on mixed\.$#' + identifier: method.nonObject + count: 5 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method prototype\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method scalarNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 37 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method scalarPrototype\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method setDeprecated\(\) on mixed\.$#' + identifier: method.nonObject + count: 17 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method then\(\) on mixed\.$#' + identifier: method.nonObject + count: 7 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method thenInvalid\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method treatFalseLike\(\) on mixed\.$#' + identifier: method.nonObject + count: 11 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method treatNullLike\(\) on mixed\.$#' + identifier: method.nonObject + count: 11 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method treatTrueLike\(\) on mixed\.$#' + identifier: method.nonObject + count: 11 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Cannot call method validate\(\) on mixed\.$#' + identifier: method.nonObject count: 1 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Strict comparison using \!\=\= between mixed and null will always evaluate to true\.$#' + identifier: notIdentical.alwaysTrue + count: 3 + path: src/Resources/config/definition/service_worker.php + + - + message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/Resources/config/definition/web_client.php + + - + message: '#^Cannot call method defaultNull\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/web_client.php + + - + message: '#^Cannot call method end\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: src/Resources/config/definition/web_client.php + + - + message: '#^Cannot call method info\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 path: src/Resources/config/definition/web_client.php - - message: "#^Cannot call method process\\(\\) on SpomkyLabs\\\\PwaBundle\\\\ImageProcessor\\\\ImageProcessorInterface\\|null\\.$#" + message: '#^Cannot call method scalarNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/Resources/config/definition/web_client.php + + - + message: '#^Return type \(iterable\\) of method SpomkyLabs\\PwaBundle\\Service\\ApplicationIconCompiler\:\:getFiles\(\) should be covariant with return type \(iterable\\) of method SpomkyLabs\\PwaBundle\\Service\\FileCompilerInterface\:\:getFiles\(\)$#' + identifier: method.childReturnType count: 1 - path: src/Service/FaviconsCompiler.php + path: src/Service/ApplicationIconCompiler.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Service\\\\FaviconsCompiler\\:\\:getFavicon\\(\\) should return array\\{string, string\\} but returns array\\{string\\|false, string\\}\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Service\\Data\:\:getData\(\) should return string but returns mixed\.$#' + identifier: return.type count: 1 - path: src/Service/FaviconsCompiler.php + path: src/Service/Data.php - - message: "#^Cannot access property \\$sourcePath on Symfony\\\\Component\\\\AssetMapper\\\\MappedAsset\\|null\\.$#" + message: '#^Property SpomkyLabs\\PwaBundle\\Service\\Data\:\:\$data \(Closure\|string\) does not accept mixed\.$#' + identifier: assign.propertyType count: 1 - path: src/Service/IconResolver.php + path: src/Service/Data.php - - message: "#^Parameter \\#3 \\$headers of class SpomkyLabs\\\\PwaBundle\\\\Service\\\\Data constructor expects array\\, array\\ given\\.$#" - count: 2 - path: src/Service/IconResolver.php + message: '#^Cannot call method process\(\) on SpomkyLabs\\PwaBundle\\ImageProcessor\\ImageProcessorInterface\|null\.$#' + identifier: method.nonObject + count: 1 + path: src/Service/FaviconsCompiler.php - - message: "#^Attribute class Symfony\\\\Component\\\\DependencyInjection\\\\Attribute\\\\TaggedIterator is deprecated\\: since Symfony 7\\.1, use \\{@see AutowireIterator\\} instead\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\Service\\FaviconsCompiler\:\:getFavicon\(\) should return array\{string, string\} but returns array\{string\|false, string\}\.$#' + identifier: return.type count: 1 - path: src/Service/ServiceWorkerCompiler.php + path: src/Service/FaviconsCompiler.php - - message: "#^Attribute class Symfony\\\\Component\\\\DependencyInjection\\\\Attribute\\\\TaggedIterator is deprecated\\: since Symfony 7\\.1, use \\{@see AutowireIterator\\} instead\\.$#" + message: '#^Cannot access property \$sourcePath on Symfony\\Component\\AssetMapper\\MappedAsset\|null\.$#' + identifier: property.nonObject count: 1 - path: src/ServiceWorkerRule/AppendCacheStrategies.php + path: src/Service/IconResolver.php + + - + message: '#^Parameter \#3 \$headers of class SpomkyLabs\\PwaBundle\\Service\\Data constructor expects array\, array\ given\.$#' + identifier: argument.type + count: 2 + path: src/Service/IconResolver.php - - message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" + message: '#^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#' + identifier: argument.type count: 1 path: src/ServiceWorkerRule/AppendCacheStrategies.php - - message: "#^Strict comparison using \\=\\=\\= between int\\<1, max\\> and 0 will always evaluate to false\\.$#" + message: '#^Strict comparison using \=\=\= between int\<1, max\> and 0 will always evaluate to false\.$#' + identifier: identical.alwaysFalse count: 1 path: src/ServiceWorkerRule/OfflineFallback.php - - message: "#^Method SpomkyLabs\\\\PwaBundle\\\\SpomkyLabsPwaBundle\\:\\:loadExtension\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + message: '#^Cannot access offset ''dest'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/SpomkyLabsPwaBundle.php - - message: "#^Attribute class Symfony\\\\Component\\\\DependencyInjection\\\\Attribute\\\\TaggedIterator is deprecated\\: since Symfony 7\\.1, use \\{@see AutowireIterator\\} instead\\.$#" - count: 1 - path: src/Subscriber/FileCompileEventListener.php + message: '#^Cannot access offset ''enabled'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 4 + path: src/SpomkyLabsPwaBundle.php - - message: "#^Attribute class Symfony\\\\Component\\\\DependencyInjection\\\\Attribute\\\\TaggedIterator is deprecated\\: since Symfony 7\\.1, use \\{@see AutowireIterator\\} instead\\.$#" + message: '#^Cannot access offset ''public_url'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 - path: src/Subscriber/PwaDevServerSubscriber.php + path: src/SpomkyLabsPwaBundle.php - - message: "#^Call to method getNonce\\(\\) on an unknown class Nelmio\\\\SecurityBundle\\\\EventListener\\\\ContentSecurityPolicyListener\\.$#" + message: '#^Cannot access offset ''serviceworker'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 - path: src/Twig/PwaRuntime.php + path: src/SpomkyLabsPwaBundle.php - - message: "#^Parameter \\$cspListener of method SpomkyLabs\\\\PwaBundle\\\\Twig\\\\PwaRuntime\\:\\:__construct\\(\\) has invalid type Nelmio\\\\SecurityBundle\\\\EventListener\\\\ContentSecurityPolicyListener\\.$#" + message: '#^Method SpomkyLabs\\PwaBundle\\SpomkyLabsPwaBundle\:\:loadExtension\(\) has parameter \$config with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 - path: src/Twig/PwaRuntime.php + path: src/SpomkyLabsPwaBundle.php - - message: "#^Property SpomkyLabs\\\\PwaBundle\\\\Twig\\\\PwaRuntime\\:\\:\\$cspListener has unknown class Nelmio\\\\SecurityBundle\\\\EventListener\\\\ContentSecurityPolicyListener as its type\\.$#" - count: 1 - path: src/Twig/PwaRuntime.php + message: '#^Parameter \#2 \$id of method Symfony\\Component\\DependencyInjection\\ContainerBuilder\:\:setAlias\(\) expects string\|Symfony\\Component\\DependencyInjection\\Alias, mixed given\.$#' + identifier: argument.type + count: 3 + path: src/SpomkyLabsPwaBundle.php + + - + message: '#^Parameter \#2 \$value of method Symfony\\Component\\DependencyInjection\\Container\:\:setParameter\(\) expects array\|bool\|float\|int\|string\|UnitEnum\|null, mixed given\.$#' + identifier: argument.type + count: 8 + path: src/SpomkyLabsPwaBundle.php - - message: "#^Unreachable statement \\- code above always terminates\\.$#" + message: '#^Unreachable statement \- code above always terminates\.$#' + identifier: deadCode.unreachable count: 1 - path: tests/Functional/TakeScreenshotCommandTest.php \ No newline at end of file + path: tests/Functional/TakeScreenshotCommandTest.php diff --git a/phpstan.neon b/phpstan.neon index 1dd34f5..094aebc 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,16 +1,16 @@ parameters: - level: max - paths: - - src - - tests - checkMissingIterableValueType: true - checkGenericClassInNonGenericObjectType: true - checkUninitializedProperties: true - treatPhpDocTypesAsCertain: false - banned_code: - non_ignorable: false - scanFiles: - - vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php + level: max + paths: + - src + - tests + + banned_code: + non_ignorable: false + checkUninitializedProperties: true + treatPhpDocTypesAsCertain: false + scanFiles: + - vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php + includes: - - vendor/phpstan/phpstan/conf/bleedingEdge.neon - - phpstan-baseline.neon \ No newline at end of file + - vendor/phpstan/phpstan/conf/bleedingEdge.neon + - phpstan-baseline.neon diff --git a/src/CachingStrategy/AssetCache.php b/src/CachingStrategy/AssetCache.php index 7e69c70..1432cb2 100644 --- a/src/CachingStrategy/AssetCache.php +++ b/src/CachingStrategy/AssetCache.php @@ -94,7 +94,7 @@ private function getAssets(): array { $assets = []; foreach ($this->assetMapper->allAssets() as $asset) { - if (preg_match($this->workbox->assetCache->regex, $asset->sourcePath) === 1) { + if (preg_match($this->workbox->assetCache->regex, $asset->publicPath) === 1) { $assets[] = $asset->publicPath; } } diff --git a/src/CachingStrategy/BackgroundSync.php b/src/CachingStrategy/BackgroundSync.php index 40bf521..9ba948a 100644 --- a/src/CachingStrategy/BackgroundSync.php +++ b/src/CachingStrategy/BackgroundSync.php @@ -11,7 +11,7 @@ use SpomkyLabs\PwaBundle\MatchCallbackHandler\MatchCallbackHandlerInterface; use SpomkyLabs\PwaBundle\Service\CanLogInterface; use SpomkyLabs\PwaBundle\WorkboxPlugin\BackgroundSyncPlugin; -use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; +use Symfony\Component\DependencyInjection\Attribute\AutowireIterator; final class BackgroundSync implements HasCacheStrategiesInterface, CanLogInterface { @@ -24,7 +24,7 @@ final class BackgroundSync implements HasCacheStrategiesInterface, CanLogInterfa */ public function __construct( ServiceWorker $serviceWorker, - #[TaggedIterator('spomky_labs_pwa.match_callback_handler')] + #[AutowireIterator('spomky_labs_pwa.match_callback_handler')] private readonly iterable $matchCallbackHandlers, ) { $this->workbox = $serviceWorker->workbox; diff --git a/src/CachingStrategy/FontCache.php b/src/CachingStrategy/FontCache.php index 3b4728c..d9e54ea 100644 --- a/src/CachingStrategy/FontCache.php +++ b/src/CachingStrategy/FontCache.php @@ -90,7 +90,7 @@ private function getFonts(): array { $fonts = []; foreach ($this->assetMapper->allAssets() as $asset) { - if (preg_match($this->workbox->fontCache->regex, $asset->sourcePath) === 1) { + if (preg_match($this->workbox->fontCache->regex, $asset->publicPath) === 1) { $fonts[] = $asset->publicPath; } } diff --git a/src/CachingStrategy/PreloadUrlsGeneratorManager.php b/src/CachingStrategy/PreloadUrlsGeneratorManager.php index b740a19..db3dbd0 100644 --- a/src/CachingStrategy/PreloadUrlsGeneratorManager.php +++ b/src/CachingStrategy/PreloadUrlsGeneratorManager.php @@ -8,7 +8,7 @@ use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; use SpomkyLabs\PwaBundle\Service\CanLogInterface; -use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; +use Symfony\Component\DependencyInjection\Attribute\AutowireIterator; use function array_key_exists; use function sprintf; @@ -25,7 +25,7 @@ final class PreloadUrlsGeneratorManager implements CanLogInterface * @param PreloadUrlsGeneratorInterface[] $generators */ public function __construct( - #[TaggedIterator('spomky_labs_pwa.preload_urls_generator')] + #[AutowireIterator('spomky_labs_pwa.preload_urls_generator')] iterable $generators ) { $this->logger = new NullLogger(); diff --git a/src/CachingStrategy/ResourceCaches.php b/src/CachingStrategy/ResourceCaches.php index 3fe2e3d..da4cb23 100644 --- a/src/CachingStrategy/ResourceCaches.php +++ b/src/CachingStrategy/ResourceCaches.php @@ -16,7 +16,7 @@ use SpomkyLabs\PwaBundle\WorkboxPlugin\ExpirationPlugin; use SpomkyLabs\PwaBundle\WorkboxPlugin\RangeRequestsPlugin; use Symfony\Component\DependencyInjection\Attribute\Autowire; -use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; +use Symfony\Component\DependencyInjection\Attribute\AutowireIterator; use Symfony\Component\Serializer\Encoder\JsonEncode; use Symfony\Component\Serializer\SerializerInterface; use function count; @@ -41,7 +41,7 @@ public function __construct( private readonly PreloadUrlsGeneratorManager $preloadUrlsGeneratorManager, ServiceWorker $serviceWorker, private readonly SerializerInterface $serializer, - #[TaggedIterator('spomky_labs_pwa.match_callback_handler')] + #[AutowireIterator('spomky_labs_pwa.match_callback_handler')] private readonly iterable $matchCallbackHandlers, #[Autowire(param: 'kernel.debug')] bool $debug, diff --git a/src/Command/ListCacheStrategiesCommand.php b/src/Command/ListCacheStrategiesCommand.php index ba0d1b1..5bebe2a 100644 --- a/src/Command/ListCacheStrategiesCommand.php +++ b/src/Command/ListCacheStrategiesCommand.php @@ -14,7 +14,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; +use Symfony\Component\DependencyInjection\Attribute\AutowireIterator; use Symfony\Component\Yaml\Yaml; use function count; @@ -25,7 +25,7 @@ final class ListCacheStrategiesCommand extends Command * @param iterable $services */ public function __construct( - #[TaggedIterator('spomky_labs_pwa.cache_strategy')] + #[AutowireIterator('spomky_labs_pwa.cache_strategy')] private readonly iterable $services, ) { parent::__construct(); diff --git a/src/DataCollector/PwaCollector.php b/src/DataCollector/PwaCollector.php index 0fb7862..951b32f 100644 --- a/src/DataCollector/PwaCollector.php +++ b/src/DataCollector/PwaCollector.php @@ -13,7 +13,7 @@ use SpomkyLabs\PwaBundle\Service\FaviconsCompiler; use SpomkyLabs\PwaBundle\Service\ManifestCompiler; use SpomkyLabs\PwaBundle\Service\ServiceWorkerCompiler; -use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; +use Symfony\Component\DependencyInjection\Attribute\AutowireIterator; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\DataCollector\DataCollector; @@ -37,7 +37,7 @@ final class PwaCollector extends DataCollector */ public function __construct( private readonly SerializerInterface $serializer, - #[TaggedIterator('spomky_labs_pwa.cache_strategy')] + #[AutowireIterator('spomky_labs_pwa.cache_strategy')] private readonly iterable $cachingServices, private readonly Manifest $manifest, private readonly ServiceWorker $serviceWorker, @@ -48,7 +48,7 @@ public function __construct( ) { } - public function collect(Request $request, Response $response, Throwable $exception = null): void + public function collect(Request $request, Response $response, ?Throwable $exception = null): void { $jsonOptions = [ AbstractObjectNormalizer::SKIP_UNINITIALIZED_VALUES => true, diff --git a/src/Normalizer/AssetNormalizer.php b/src/Normalizer/AssetNormalizer.php index 5521de7..dc40999 100644 --- a/src/Normalizer/AssetNormalizer.php +++ b/src/Normalizer/AssetNormalizer.php @@ -21,29 +21,29 @@ public function __construct( /** * @return array{src: string, sizes?: string, form_factor?: string, label?: string, platform?: string, format?: string} */ - public function normalize(mixed $object, string $format = null, array $context = []): string + public function normalize(mixed $data, ?string $format = null, array $context = []): string { - assert($object instanceof Asset); + assert($data instanceof Asset); $url = null; - if (! str_starts_with($object->src, '/')) { - $asset = $this->assetMapper->getAsset($object->src); + if (! str_starts_with($data->src, '/')) { + $asset = $this->assetMapper->getAsset($data->src); $url = $asset?->publicPath; } if ($url === null) { - $url = $object->src; + $url = $data->src; } return $url; } - public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { assert(is_string($data)); return Asset::create($data); } - public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { return $data instanceof Asset; } @@ -51,7 +51,7 @@ public function supportsNormalization(mixed $data, string $format = null, array public function supportsDenormalization( mixed $data, string $type, - string $format = null, + ?string $format = null, array $context = [] ): bool { return $type === Asset::class; diff --git a/src/Normalizer/IconNormalizer.php b/src/Normalizer/IconNormalizer.php index e9a10ef..1043f31 100644 --- a/src/Normalizer/IconNormalizer.php +++ b/src/Normalizer/IconNormalizer.php @@ -23,17 +23,17 @@ public function __construct( /** * @return array{src: string, sizes?: string, type?: string, purpose?: string} */ - public function normalize(mixed $object, string $format = null, array $context = []): array + public function normalize(mixed $data, ?string $format = null, array $context = []): array { - assert($object instanceof Icon); - $icon = $this->iconResolver->getIcon($object); - $imageType = $this->iconResolver->getType($object->type, $icon->url); + assert($data instanceof Icon); + $icon = $this->iconResolver->getIcon($data); + $imageType = $this->iconResolver->getType($data->type, $icon->url); $result = [ 'src' => $icon->url, - 'sizes' => $object->getSizeList(), + 'sizes' => $data->getSizeList(), 'type' => $imageType, - 'purpose' => $object->purpose, + 'purpose' => $data->purpose, ]; $cleanup = static fn (array $data): array => array_filter( @@ -44,7 +44,7 @@ public function normalize(mixed $object, string $format = null, array $context = return $cleanup($result); } - public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { return $data instanceof Icon; } diff --git a/src/Normalizer/ScreenshotNormalizer.php b/src/Normalizer/ScreenshotNormalizer.php index f816a1e..d95dbf0 100644 --- a/src/Normalizer/ScreenshotNormalizer.php +++ b/src/Normalizer/ScreenshotNormalizer.php @@ -28,23 +28,23 @@ public function __construct( /** * @return array{src: string, sizes?: string, form_factor?: string, label?: string, platform?: string, format?: string} */ - public function normalize(mixed $object, string $format = null, array $context = []): array + public function normalize(mixed $data, ?string $format = null, array $context = []): array { - assert($object instanceof Screenshot); + assert($data instanceof Screenshot); $asset = null; - $imageType = $object->type; - if ($imageType === null && ! str_starts_with($object->src->src, '/')) { - $asset = $this->assetMapper->getAsset($object->src->src); + $imageType = $data->type; + if ($imageType === null && ! str_starts_with($data->src->src, '/')) { + $asset = $this->assetMapper->getAsset($data->src->src); $imageType = $this->getType($asset); } - ['sizes' => $sizes, 'formFactor' => $formFactor] = $this->getSizes($object, $asset); + ['sizes' => $sizes, 'formFactor' => $formFactor] = $this->getSizes($data, $asset); $result = [ - 'src' => $this->normalizer->normalize($object->src, $format, $context), + 'src' => $this->normalizer->normalize($data->src, $format, $context), 'sizes' => $sizes, 'form_factor' => $formFactor, - 'label' => $object->label, - 'platform' => $object->platform, + 'label' => $data->label, + 'platform' => $data->platform, 'format' => $imageType, ]; @@ -55,7 +55,7 @@ public function normalize(mixed $object, string $format = null, array $context = return $cleanup($result); } - public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { return $data instanceof Screenshot; } diff --git a/src/Normalizer/ServiceWorkerNormalizer.php b/src/Normalizer/ServiceWorkerNormalizer.php index c9d11a8..2480074 100644 --- a/src/Normalizer/ServiceWorkerNormalizer.php +++ b/src/Normalizer/ServiceWorkerNormalizer.php @@ -13,14 +13,14 @@ /** * @return array{scope?: string, src: string, use_cache?: bool} */ - public function normalize(mixed $object, string $format = null, array $context = []): array + public function normalize(mixed $data, ?string $format = null, array $context = []): array { - assert($object instanceof ServiceWorker); + assert($data instanceof ServiceWorker); $result = [ - 'src' => '/' . trim($object->dest, '/'), - 'scope' => $object->scope, - 'use_cache' => $object->useCache, + 'src' => '/' . trim($data->dest, '/'), + 'scope' => $data->scope, + 'use_cache' => $data->useCache, ]; $cleanup = static fn (array $data): array => array_filter( @@ -30,7 +30,7 @@ public function normalize(mixed $object, string $format = null, array $context = return $cleanup($result); } - public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { return $data instanceof ServiceWorker; } diff --git a/src/Normalizer/UrlNormalizer.php b/src/Normalizer/UrlNormalizer.php index e373fef..84ebafb 100644 --- a/src/Normalizer/UrlNormalizer.php +++ b/src/Normalizer/UrlNormalizer.php @@ -24,31 +24,31 @@ public function __construct( ) { } - public function normalize(mixed $object, string $format = null, array $context = []): string + public function normalize(mixed $data, ?string $format = null, array $context = []): string { - assert($object instanceof Url); + assert($data instanceof Url); // If the path is a valid URL, we return it directly - if (str_starts_with($object->path, '/') && filter_var($object->path, FILTER_VALIDATE_URL) !== false) { - return $object->path; + if (str_starts_with($data->path, '/') && filter_var($data->path, FILTER_VALIDATE_URL) !== false) { + return $data->path; } // If the path is an asset, we return the public path - $asset = $this->assetMapper->getAsset($object->path); + $asset = $this->assetMapper->getAsset($data->path); if ($asset !== null) { return $asset->publicPath; } // Otherwise, we try to generate the URL try { - return $this->router->generate($object->path, $object->params, $object->pathTypeReference); + return $this->router->generate($data->path, $data->params, $data->pathTypeReference); } catch (Throwable) { // If the URL cannot be generated, we return the path as is - return $object->path; + return $data->path; } } - public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { return $data instanceof Url; } diff --git a/src/Service/FaviconsCompiler.php b/src/Service/FaviconsCompiler.php index 37fbb1c..372b01e 100644 --- a/src/Service/FaviconsCompiler.php +++ b/src/Service/FaviconsCompiler.php @@ -33,7 +33,7 @@ public function __construct( } /** - * @return iterable + * @return iterable */ public function getFiles(): iterable { @@ -235,14 +235,15 @@ public function getFiles(): iterable ); $completeHash = hash('xxh128', $hash . $configuration); $filename = sprintf($size['url'], $size['width'], $size['height'], $completeHash); - yield $this->processIcon($asset, $filename, $configuration, $size['mimetype'], $size['rel']); + yield $filename => $this->processIcon($asset, $filename, $configuration, $size['mimetype'], $size['rel']); } if ($this->favicons->tileColor !== null) { $this->logger->debug('Creating browserconfig.xml.'); yield from $this->processBrowserConfig($asset, $hash); } if ($this->favicons->safariPinnedTabColor !== null && $this->favicons->useSilhouette === true) { - yield $this->generateSafariPinnedTab($asset, $hash); + $safariPinnedTab = $this->generateSafariPinnedTab($asset, $hash); + yield $safariPinnedTab->url => $safariPinnedTab; } $this->logger->debug('Favicons created.'); } @@ -401,17 +402,17 @@ private function processBrowserConfig(string $asset, string $hash): array ); return [ - $icon70x70, - $icon150x150, - $icon310x310, - $icon310x150, - Data::create( + $icon70x70->url => $icon70x70, + $icon150x150->url => $icon150x150, + $icon310x310->url => $icon310x310, + $icon310x150->url => $icon310x150, + $icon144x144->url => Data::create( $icon144x144->url, $icon144x144->getRawData(), $icon144x144->headers, sprintf('', $icon144x144->url) ), - $browserConfig, + $browserConfig->url => $browserConfig, ]; } diff --git a/src/Service/FileCompilerInterface.php b/src/Service/FileCompilerInterface.php index a119a53..bd88c1b 100644 --- a/src/Service/FileCompilerInterface.php +++ b/src/Service/FileCompilerInterface.php @@ -7,7 +7,7 @@ interface FileCompilerInterface { /** - * @return iterable + * @return iterable */ public function getFiles(): iterable; } diff --git a/src/Service/ManifestCompiler.php b/src/Service/ManifestCompiler.php index 506d153..6d8819e 100644 --- a/src/Service/ManifestCompiler.php +++ b/src/Service/ManifestCompiler.php @@ -66,7 +66,7 @@ public function __construct( } /** - * @return iterable + * @return iterable */ public function getFiles(): iterable { @@ -81,13 +81,15 @@ public function getFiles(): iterable } if ($this->locales === []) { $this->logger->debug('No locale defined. Compiling default manifest.'); - yield $this->compileManifest(null); + $manifest = $this->compileManifest(null); + yield $manifest->url => $manifest; } foreach ($this->locales as $locale) { $this->logger->debug('Compiling manifest for locale.', [ 'locale' => $locale, ]); - yield $this->compileManifest($locale); + $manifest = $this->compileManifest($locale); + yield $manifest->url => $manifest; } $this->logger->debug('Manifest files compiled.'); } diff --git a/src/Service/ServiceWorkerCompiler.php b/src/Service/ServiceWorkerCompiler.php index 955fdd2..9dbd418 100644 --- a/src/Service/ServiceWorkerCompiler.php +++ b/src/Service/ServiceWorkerCompiler.php @@ -11,7 +11,7 @@ use Symfony\Component\AssetMapper\AssetMapperInterface; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Attribute\Autowire; -use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; +use Symfony\Component\DependencyInjection\Attribute\AutowireIterator; use function assert; use function count; use function in_array; @@ -35,7 +35,7 @@ final class ServiceWorkerCompiler implements FileCompilerInterface, CanLogInterf public function __construct( private readonly ServiceWorker $serviceWorker, private readonly AssetMapperInterface $assetMapper, - #[TaggedIterator('spomky_labs_pwa.service_worker_rule', defaultPriorityMethod: 'getPriority')] + #[AutowireIterator('spomky_labs_pwa.service_worker_rule', defaultPriorityMethod: 'getPriority')] private readonly iterable $serviceworkerRules, #[Autowire(param: 'kernel.debug')] public readonly bool $debug, @@ -54,11 +54,12 @@ public function __construct( } /** - * @return iterable + * @return iterable */ public function getFiles(): iterable { - yield $this->compileSW(); + $sw = $this->compileSW(); + yield $sw->url => $sw; yield from $this->getWorkboxFiles(); } @@ -119,7 +120,7 @@ private function includeRootSW(): string } /** - * @return iterable + * @return iterable */ private function getWorkboxFiles(): iterable { @@ -151,7 +152,7 @@ private function getWorkboxFiles(): iterable if ($data === null) { continue; } - yield $data; + yield $data->url => $data; } } diff --git a/src/ServiceWorkerRule/AppendCacheStrategies.php b/src/ServiceWorkerRule/AppendCacheStrategies.php index 219a578..b2b3691 100644 --- a/src/ServiceWorkerRule/AppendCacheStrategies.php +++ b/src/ServiceWorkerRule/AppendCacheStrategies.php @@ -6,7 +6,7 @@ use SpomkyLabs\PwaBundle\CachingStrategy\HasCacheStrategiesInterface; use Symfony\Component\DependencyInjection\Attribute\Autowire; -use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; +use Symfony\Component\DependencyInjection\Attribute\AutowireIterator; use function sprintf; use const PHP_EOL; @@ -16,7 +16,7 @@ * @param iterable $cacheStrategies */ public function __construct( - #[TaggedIterator('spomky_labs_pwa.cache_strategy')] + #[AutowireIterator('spomky_labs_pwa.cache_strategy')] private iterable $cacheStrategies, #[Autowire(param: 'kernel.debug')] public bool $debug, diff --git a/src/Subscriber/FileCompileEventListener.php b/src/Subscriber/FileCompileEventListener.php index b00d8d2..cc6fa7f 100644 --- a/src/Subscriber/FileCompileEventListener.php +++ b/src/Subscriber/FileCompileEventListener.php @@ -11,7 +11,7 @@ use Symfony\Component\AssetMapper\Event\PreAssetsCompileEvent; use Symfony\Component\AssetMapper\Path\PublicAssetsFilesystemInterface; use Symfony\Component\DependencyInjection\Attribute\Autowire; -use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; +use Symfony\Component\DependencyInjection\Attribute\AutowireIterator; use Symfony\Component\EventDispatcher\Attribute\AsEventListener; #[AsEventListener(PreAssetsCompileEvent::class)] @@ -23,7 +23,7 @@ final class FileCompileEventListener implements CanLogInterface * @param iterable $fileCompilers */ public function __construct( - #[TaggedIterator('spomky_labs_pwa.compiler')] + #[AutowireIterator('spomky_labs_pwa.compiler')] private readonly iterable $fileCompilers, #[Autowire('@asset_mapper.local_public_assets_filesystem')] private readonly PublicAssetsFilesystemInterface $assetsFilesystem, diff --git a/src/Subscriber/PwaDevServerSubscriber.php b/src/Subscriber/PwaDevServerSubscriber.php index 3c5bfe8..df5f936 100644 --- a/src/Subscriber/PwaDevServerSubscriber.php +++ b/src/Subscriber/PwaDevServerSubscriber.php @@ -9,7 +9,7 @@ use SpomkyLabs\PwaBundle\Service\CanLogInterface; use SpomkyLabs\PwaBundle\Service\Data; use SpomkyLabs\PwaBundle\Service\FileCompilerInterface; -use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; +use Symfony\Component\DependencyInjection\Attribute\AutowireIterator; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\RequestEvent; @@ -25,7 +25,7 @@ final class PwaDevServerSubscriber implements EventSubscriberInterface, CanLogIn * @param iterable $fileCompilers */ public function __construct( - #[TaggedIterator('spomky_labs_pwa.compiler')] + #[AutowireIterator('spomky_labs_pwa.compiler')] private readonly iterable $fileCompilers, private readonly null|Profiler $profiler, ) { @@ -58,7 +58,7 @@ public function onKernelRequest(RequestEvent $event): void public function onKernelResponse(ResponseEvent $event): void { $headers = $event->getResponse() -->headers; + ->headers; if ($headers->has('X-Pwa-Dev')) { $event->stopPropagation(); } diff --git a/tests/Functional/CompileCommandTest.php b/tests/Functional/CompileCommandTest.php index d4d3233..899d26b 100644 --- a/tests/Functional/CompileCommandTest.php +++ b/tests/Functional/CompileCommandTest.php @@ -29,22 +29,20 @@ public static function theFileAreCompiled(): void static::assertFileExists(self::$kernel->getCacheDir() . '/output/site.webmanifest'); static::assertFileExists(self::$kernel->getCacheDir() . '/output/sw.js'); static::assertFileExists( - self::$kernel->getCacheDir() . '/output/assets/pwa/screenshots/360x800-86e5e530cd7674b4f1137a418b6d0264.svg' + self::$kernel->getCacheDir() . '/output/assets/pwa/screenshots/360x800-huXlMM1.svg' ); static::assertFileExists( - self::$kernel->getCacheDir() . '/output/assets/pwa/screenshots/390x844-3f5c4bdccd303b49c95aa4344651c7e2.svg' + self::$kernel->getCacheDir() . '/output/assets/pwa/screenshots/390x844-P1xL3M0.svg' ); static::assertFileExists( - self::$kernel->getCacheDir() . '/output/assets/pwa/screenshots/600x400-a6d84c84616946feb5f92f8ca0ae4047.svg' + self::$kernel->getCacheDir() . '/output/assets/pwa/screenshots/600x400-pthMhGF.svg' ); static::assertFileExists( - self::$kernel->getCacheDir() . '/output/assets/pwa/screenshots/780x360-5bf5dc07ede9d26a9b2e9dc9f53d1959.svg' + self::$kernel->getCacheDir() . '/output/assets/pwa/screenshots/780x360-W_XcB-3.svg' ); static::assertFileExists( - self::$kernel->getCacheDir() . '/output/assets/pwa/screenshots/915x412-6141e808964c20e880f141190100d6e6.svg' - ); - static::assertFileExists( - self::$kernel->getCacheDir() . '/output/assets/pwa/1920x1920-862cb89ba358ac021badfbe32a89bbfb.svg' + self::$kernel->getCacheDir() . '/output/assets/pwa/screenshots/915x412-YUHoCJZ.svg' ); + static::assertFileExists(self::$kernel->getCacheDir() . '/output/assets/pwa/1920x1920-hiy4m6N.svg'); } } diff --git a/tests/config.php b/tests/config.php index cc6bbac..69a0dac 100644 --- a/tests/config.php +++ b/tests/config.php @@ -32,6 +32,9 @@ ], 'http_method_override' => true, 'handle_all_throwables' => true, + 'assets' => [ + 'enabled' => true, + ], 'session' => [ 'storage_factory_id' => 'session.storage.factory.mock_file', 'cookie_secure' => 'auto',