diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1d393d75b9..8017126337 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -4155,11 +4155,6 @@ parameters: count: 1 path: src/bundle/Debug/IbexaDebugBundle.php - - - message: "#^Method Ibexa\\\\Bundle\\\\Debug\\\\Twig\\\\DebugTemplate\\:\\:display\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/Debug/Twig/DebugTemplate.php - - message: "#^Method Ibexa\\\\Bundle\\\\Debug\\\\Twig\\\\DebugTemplate\\:\\:display\\(\\) has parameter \\$blocks with no value type specified in iterable type array\\.$#" count: 1 @@ -4170,11 +4165,6 @@ parameters: count: 1 path: src/bundle/Debug/Twig/DebugTemplate.php - - - message: "#^Method Ibexa\\\\Bundle\\\\Debug\\\\Twig\\\\DebugTemplate\\:\\:doDisplay\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/Debug/Twig/DebugTemplate.php - - message: "#^Method Ibexa\\\\Bundle\\\\Debug\\\\Twig\\\\DebugTemplate\\:\\:doDisplay\\(\\) has parameter \\$blocks with no value type specified in iterable type array\\.$#" count: 1 @@ -4185,16 +4175,6 @@ parameters: count: 1 path: src/bundle/Debug/Twig/DebugTemplate.php - - - message: "#^Method Ibexa\\\\Bundle\\\\Debug\\\\Twig\\\\DebugTemplate\\:\\:getDebugInfo\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/bundle/Debug/Twig/DebugTemplate.php - - - - message: "#^Method Ibexa\\\\Bundle\\\\Debug\\\\Twig\\\\DebugTemplate\\:\\:getSourceContext\\(\\) should return Twig\\\\Source but returns string\\.$#" - count: 1 - path: src/bundle/Debug/Twig/DebugTemplate.php - - message: "#^Parameter \\#1 \\$haystack of function stripos expects string, string\\|false\\|null given\\.$#" count: 1 @@ -7375,11 +7355,6 @@ parameters: count: 1 path: src/contracts/Repository/Values/Content/Trash/TrashItemDeleteResultList.php - - - message: "#^PHPDoc tag @property\\-read has invalid value \\(string\\[\\] languageCodes the languages for which this alias is valid\\)\\: Unexpected token \"languageCodes\", expected variable at offset 451$#" - count: 1 - path: src/contracts/Repository/Values/Content/URLAlias.php - - message: "#^Class Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLWildcard\\\\SearchResult implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" count: 1 @@ -21215,11 +21190,6 @@ parameters: count: 1 path: src/lib/Repository/TrashService.php - - - message: "#^Access to protected property Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLAlias\\:\\:\\$languageCodes\\.$#" - count: 2 - path: src/lib/Repository/URLAliasService.php - - message: "#^Class Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\UrlAlias referenced with incorrect case\\: Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\URLAlias\\.$#" count: 7 @@ -27370,11 +27340,6 @@ parameters: count: 9 path: tests/integration/Core/Repository/ContentServiceTest.php - - - message: "#^Access to protected property Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLAlias\\:\\:\\$languageCodes\\.$#" - count: 2 - path: tests/integration/Core/Repository/ContentServiceTest.php - - message: "#^Argument of an invalid type Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\ContentMetadataUpdateStruct supplied for foreach, only iterables are supported\\.$#" count: 1 @@ -38810,11 +38775,6 @@ parameters: count: 1 path: tests/integration/Core/Repository/URLAliasServiceAuthorizationTest.php - - - message: "#^Access to protected property Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLAlias\\:\\:\\$languageCodes\\.$#" - count: 1 - path: tests/integration/Core/Repository/URLAliasServiceTest.php - - message: "#^Cannot access offset 0 on iterable\\\\.$#" count: 1 @@ -59800,11 +59760,6 @@ parameters: count: 1 path: tests/lib/Repository/Service/Mock/SearchTest.php - - - message: "#^Access to protected property Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLAlias\\:\\:\\$languageCodes\\.$#" - count: 3 - path: tests/lib/Repository/Service/Mock/UrlAliasTest.php - - message: "#^Cannot access offset 0 on iterable\\\\.$#" count: 3 diff --git a/src/bundle/Debug/Twig/DebugTemplate.php b/src/bundle/Debug/Twig/DebugTemplate.php index d943744d69..958602d601 100644 --- a/src/bundle/Debug/Twig/DebugTemplate.php +++ b/src/bundle/Debug/Twig/DebugTemplate.php @@ -7,6 +7,7 @@ namespace Ibexa\Bundle\Debug\Twig; use Symfony\Component\Filesystem\Filesystem; +use Twig\Source; use Twig\Template; /** @@ -19,7 +20,7 @@ class DebugTemplate extends Template { private $fileSystem; - public function display(array $context, array $blocks = []) + public function display(array $context, array $blocks = []): void { $this->fileSystem = $this->fileSystem ?: new Filesystem(); @@ -65,34 +66,25 @@ public function display(array $context, array $blocks = []) } } - /** - * {@inheritdoc} - */ - public function getTemplateName() + public function getTemplateName(): string { return ''; } - /** - * {@inheritdoc} - */ - public function getSourceContext() + public function getSourceContext(): Source { - return ''; + return new Source('', ''); } - /** - * {@inheritdoc} - */ - protected function doDisplay(array $context, array $blocks = []) + protected function doDisplay(array $context, array $blocks = []): string { return ''; } /** - * {@inheritdoc} + * @return array */ - public function getDebugInfo() + public function getDebugInfo(): array { return []; } diff --git a/src/contracts/Collection/AbstractInMemoryCollection.php b/src/contracts/Collection/AbstractInMemoryCollection.php index 529cbeea85..5acfc79edb 100644 --- a/src/contracts/Collection/AbstractInMemoryCollection.php +++ b/src/contracts/Collection/AbstractInMemoryCollection.php @@ -20,11 +20,11 @@ */ abstract class AbstractInMemoryCollection implements CollectionInterface, StreamableInterface { - /** @var TValue[] */ + /** @phpstan-var TValue[] */ protected array $items; /** - * @param TValue[] $items + * @phpstan-param TValue[] $items */ public function __construct(array $items = []) { diff --git a/src/contracts/Collection/ArrayList.php b/src/contracts/Collection/ArrayList.php index c6eaa41cca..4a639645a8 100644 --- a/src/contracts/Collection/ArrayList.php +++ b/src/contracts/Collection/ArrayList.php @@ -19,7 +19,7 @@ class ArrayList extends AbstractInMemoryCollection implements ListInterface { /** - * @param TValue[] $items + * @phpstan-param TValue[] $items */ public function __construct(array $items = []) { @@ -45,7 +45,7 @@ public function last() } /** - * @param TValue $value + * @phpstan-param TValue $value */ public function contains($value): bool { @@ -53,9 +53,9 @@ public function contains($value): bool } /** - * @param TValue[] $items + * @phpstan-param TValue[] $items * - * @return \Ibexa\Contracts\Core\Collection\ArrayList + * @phpstan-return \Ibexa\Contracts\Core\Collection\ArrayList */ protected function createFrom(array $items): self { diff --git a/src/contracts/Collection/ArrayMap.php b/src/contracts/Collection/ArrayMap.php index 37ddcf3749..698dc3a0f7 100644 --- a/src/contracts/Collection/ArrayMap.php +++ b/src/contracts/Collection/ArrayMap.php @@ -34,9 +34,9 @@ public function has($key): bool } /** - * @param TValue[] $items + * @phpstan-param TValue[] $items * - * @return \Ibexa\Contracts\Core\Collection\ArrayMap + * @phpstan-return \Ibexa\Contracts\Core\Collection\ArrayMap */ protected function createFrom(array $items): self { diff --git a/src/contracts/Repository/Values/Content/URLAlias.php b/src/contracts/Repository/Values/Content/URLAlias.php index 41c7e9136f..6e4502ff90 100644 --- a/src/contracts/Repository/Values/Content/URLAlias.php +++ b/src/contracts/Repository/Values/Content/URLAlias.php @@ -17,7 +17,7 @@ * @property-read int $type The type of the URL Alias i.e. one of URLAlias::LOCATION, URLAlias::RESOURCE, URLAlias::VIRTUAL * @property-read mixed $destination If type = URLAlias::LOCATION it is a Location id otherwise a string (e.g. /content/search) * @property-read string $path the alias path - * @property-read string[] languageCodes the languages for which this alias is valid + * @property-read string[] $languageCodes the languages for which this alias is valid * @property-read bool $alwaysAvailable Fallback indicator for other languages * @property-read bool $isHistory Indicates that this alias was autogenerated for an in the meanwhile archived version of the content * @property-read bool $isCustom If false this alias was autogenerated otherwise manuel created