From 3693184c64215d50f92d1843a0f5b6a79d1c2f22 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 10 Sep 2025 14:40:47 +0200 Subject: [PATCH 01/16] [BinaryFile Field Type] Removed redundant override of the `Type::completeValue` method Removed redundant override of the `\Ibexa\Core\FieldType\BinaryFile\Type::completeValue` method --- src/lib/FieldType/BinaryFile/Type.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/lib/FieldType/BinaryFile/Type.php b/src/lib/FieldType/BinaryFile/Type.php index c14a35e070..e0d6f582e6 100644 --- a/src/lib/FieldType/BinaryFile/Type.php +++ b/src/lib/FieldType/BinaryFile/Type.php @@ -9,7 +9,6 @@ use Ibexa\Contracts\Core\FieldType\Value as SPIValue; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; use Ibexa\Core\FieldType\BinaryBase\Type as BinaryBaseType; -use Ibexa\Core\FieldType\Value as BaseValue; use JMS\TranslationBundle\Model\Message; use JMS\TranslationBundle\Translation\TranslationContainerInterface; @@ -55,20 +54,6 @@ protected function createValue(array $inputValue) return new Value($inputValue); } - /** - * Attempts to complete the data in $value. - * - * @param \Ibexa\Core\FieldType\BinaryFile\Value|\Ibexa\Core\FieldType\Value $value - */ - protected function completeValue(Basevalue $value) - { - parent::completeValue($value); - - if (isset($value->downloadCount) && $value->downloadCount === null) { - $value->downloadCount = 0; - } - } - /** * Converts a $Value to a hash. * From 732560660cedaf81b9270ac73736bdb479fdcd2b Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 10 Sep 2025 14:43:40 +0200 Subject: [PATCH 02/16] [Media Field Type] Removed redundant override of the `Type::completeValue` method Removed redundant override of the `\Ibexa\Core\FieldType\Media\Type::completeValue` method --- src/lib/FieldType/Media/Type.php | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/lib/FieldType/Media/Type.php b/src/lib/FieldType/Media/Type.php index c416bf0cd7..9353d5837c 100644 --- a/src/lib/FieldType/Media/Type.php +++ b/src/lib/FieldType/Media/Type.php @@ -180,33 +180,6 @@ protected function checkValueStructure(BaseValue $value) } } - /** - * Attempts to complete the data in $value. - * - * @param \Ibexa\Core\FieldType\Media\Value|\Ibexa\Core\FieldType\Value $value - */ - protected function completeValue(BaseValue $value) - { - parent::completeValue($value); - - if (isset($value->hasController) && $value->hasController === null) { - $value->hasController = false; - } - if (isset($value->autoplay) && $value->autoplay === null) { - $value->autoplay = false; - } - if (isset($value->loop) && $value->loop === null) { - $value->loop = false; - } - - if (isset($value->height) && $value->height === null) { - $value->height = 0; - } - if (isset($value->width) && $value->width === null) { - $value->width = 0; - } - } - /** * Converts a $Value to a hash. * From 07fb2217eeb86811f45cc794ab26e93cb77ae1f3 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 10 Sep 2025 15:39:38 +0200 Subject: [PATCH 03/16] [Cache] Improved PersistenceLogger code quality --- src/lib/Persistence/Cache/PersistenceLogger.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/Persistence/Cache/PersistenceLogger.php b/src/lib/Persistence/Cache/PersistenceLogger.php index 53da8fbb47..a9c8307a2d 100644 --- a/src/lib/Persistence/Cache/PersistenceLogger.php +++ b/src/lib/Persistence/Cache/PersistenceLogger.php @@ -85,7 +85,7 @@ public function logCacheMiss(array $arguments = [], int $traceOffset = 2): void $trace = \debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 8 + $traceOffset); $this->collectCacheCallData( - $trace[$traceOffset - 1]['class'] . '::' . $trace[$traceOffset - 1]['function'], + $this->resolveTraceFrameName($trace[$traceOffset - 1]), $arguments, \array_slice($trace, $traceOffset), 'miss' @@ -116,7 +116,7 @@ public function logCacheHit(array $arguments = [], int $traceOffset = 2, bool $i $trace = \debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 8 + $traceOffset); $this->collectCacheCallData( - $trace[$traceOffset - 1]['class'] . '::' . $trace[$traceOffset - 1]['function'], + $this->resolveTraceFrameName($trace[$traceOffset - 1]), $arguments, \array_slice($trace, $traceOffset), $inMemory ? 'memory' : 'hit' @@ -249,6 +249,18 @@ public function getLoadedUnCachedHandlers(): array { return $this->unCachedHandlers; } + + /** + * @param array{class?: string, function: string} $traceFrame + */ + private function resolveTraceFrameName(array $traceFrame): string + { + $classNameWithScopeResolution = isset($traceFrame['class']) + ? $traceFrame['class'] . '::' + : ''; + + return $classNameWithScopeResolution . $traceFrame['function']; + } } class_alias(PersistenceLogger::class, 'eZ\Publish\Core\Persistence\Cache\PersistenceLogger'); From b5495c18804c36e9b0dd7dec6cf185385d2b1470 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 10 Sep 2025 15:45:53 +0200 Subject: [PATCH 04/16] [Tests] Added coverage for improved parts of PersistenceLogger --- .../Cache/PersistenceLoggerTest.php | 71 +++++++++++++++---- 1 file changed, 57 insertions(+), 14 deletions(-) diff --git a/tests/lib/Persistence/Cache/PersistenceLoggerTest.php b/tests/lib/Persistence/Cache/PersistenceLoggerTest.php index 23eda2909d..e29ec7a5dd 100644 --- a/tests/lib/Persistence/Cache/PersistenceLoggerTest.php +++ b/tests/lib/Persistence/Cache/PersistenceLoggerTest.php @@ -4,55 +4,50 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ +declare(strict_types=1); + namespace Ibexa\Tests\Core\Persistence\Cache; use Ibexa\Core\Persistence\Cache\PersistenceLogger; use PHPUnit\Framework\TestCase; /** - * @covers \Ibexa\Core\Persistence\Cache\PersistenceLogger::getName + * @covers \Ibexa\Core\Persistence\Cache\PersistenceLogger */ class PersistenceLoggerTest extends TestCase { - /** @var \Ibexa\Core\Persistence\Cache\PersistenceLogger */ - protected $logger; + protected PersistenceLogger $logger; - /** - * Setup the HandlerTest. - */ protected function setUp(): void { parent::setUp(); $this->logger = new PersistenceLogger(); } - /** - * Tear down test (properties). - */ protected function tearDown(): void { unset($this->logger); parent::tearDown(); } - public function testGetName() + public function testGetName(): void { $this->assertEquals(PersistenceLogger::NAME, $this->logger->getName()); } - public function testGetCount() + public function testGetCount(): void { $this->assertEquals(0, $this->logger->getCount()); } - public function testGetCalls() + public function testGetCalls(): void { $this->assertEquals([], $this->logger->getCalls()); } - public function testLogCall() + public function testLogCall(): PersistenceLogger { - $this->assertNull($this->logger->logCall(__METHOD__)); + $this->logger->logCall(__METHOD__); $this->logger->logCall(__METHOD__); $this->logger->logCall(__METHOD__); $this->logger->logCall(__METHOD__, [33]); @@ -95,6 +90,54 @@ public function testGetCallValues($logger) $this->assertCount(1, $calls[1]['traces']); $this->assertEquals(['uncached' => 1, 'miss' => 0, 'hit' => 0, 'memory' => 0], $calls[1]['stats']); } + + public function testLogCacheHit(): void + { + self::assertSame([], $this->logger->getCalls()); + $this->logger->logCacheHit(); + self::assertSame( + $this->buildExpectedCallTrace('d4371e7c', __METHOD__, 0, 1), + $this->logger->getCalls() + ); + } + + public function testLogCacheMiss(): void + { + self::assertSame([], $this->logger->getCalls()); + $this->logger->logCacheMiss(); + self::assertSame( + $this->buildExpectedCallTrace('f4051ef3', __METHOD__, 1, 0), + $this->logger->getCalls() + ); + } + + /** + * @return array> + */ + private function buildExpectedCallTrace(string $callHash, string $method, int $miss, int $hit): array + { + return [ + $callHash => [ + 'method' => $method, + 'arguments' => [], + 'stats' => [ + 'uncached' => 0, + 'miss' => $miss, + 'hit' => $hit, + 'memory' => 0, + ], + 'traces' => [ + '0e1c1b51' => [ + 'trace' => [ + 0 => 'PHPUnit\\Framework\\TestCase->runTest()', + 1 => 'PHPUnit\\Framework\\TestCase->runBare()', + ], + 'count' => 1, + ], + ], + ], + ]; + } } class_alias(PersistenceLoggerTest::class, 'eZ\Publish\Core\Persistence\Cache\Tests\PersistenceLoggerTest'); From fe52393164fcfc90181ac2440d7e9864b7b0f0fe Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 10 Sep 2025 17:10:35 +0200 Subject: [PATCH 05/16] [ConfigResolver] Removed redundant check if the `function` key exists --- .../Core/DependencyInjection/Configuration/ConfigResolver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Core/DependencyInjection/Configuration/ConfigResolver.php b/src/bundle/Core/DependencyInjection/Configuration/ConfigResolver.php index 2b4d4a194b..555dc1b7a8 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/ConfigResolver.php +++ b/src/bundle/Core/DependencyInjection/Configuration/ConfigResolver.php @@ -279,7 +279,7 @@ private function logTooEarlyLoadedListIfNeeded($paramName) // Lookup trace to find last service being loaded as possible blame for eager loading // Abort if one of the earlier services is detected to be "safe", aka updatable foreach (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 35) as $t) { - if (!isset($t['function']) || $t['function'] === 'getParameter' || $t['function'] === __FUNCTION__) { + if ($t['function'] === 'getParameter' || $t['function'] === __FUNCTION__) { continue; } From e16c8baa890211f0ec9634bccda0cfd32ff65f44 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 10 Sep 2025 17:12:06 +0200 Subject: [PATCH 06/16] [ViewProviders] Fixed the incorrect type hint of `Registry::$viewProviders` --- src/lib/MVC/Symfony/View/Provider/Registry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/MVC/Symfony/View/Provider/Registry.php b/src/lib/MVC/Symfony/View/Provider/Registry.php index 6565514840..fcb53b8c7a 100644 --- a/src/lib/MVC/Symfony/View/Provider/Registry.php +++ b/src/lib/MVC/Symfony/View/Provider/Registry.php @@ -14,7 +14,7 @@ class Registry /** * Array of ViewProvider, indexed by handled type. * - * @var \Ibexa\Core\MVC\Symfony\View\ViewProvider[][] + * @phpstan-var array> */ private $viewProviders; From b399e6cbb938ae6df2c5579a936e7f1eac55b102 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 10 Sep 2025 17:12:54 +0200 Subject: [PATCH 07/16] [ImageConverter] Handled possible null reference when parsing legacy XML --- .../Content/FieldValue/Converter/ImageConverter.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php index 3b30bd924a..a4645b7229 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php @@ -277,7 +277,13 @@ protected function parseLegacyXml($xml) foreach ($additionalDataElement->getElementsByTagName('attribute') as $datum) { /** @var \DOMNamedNodeMap $option */ $option = $datum->attributes; - $extractedData['additionalData'][$option->getNamedItem('key')->nodeValue] = $datum->nodeValue; + $domNode = $option->getNamedItem('key'); + if (null === $domNode) { + throw new \LogicException( + sprintf('ImageConverter: Failed to get "%s" key from "%s" node', 'key', $datum->getNodePath()) + ); + } + $extractedData['additionalData'][$domNode->nodeValue] = $datum->nodeValue; } } From 7a0ce6659093b184fad0e41b0d2dbfb24328f0a3 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 10 Sep 2025 17:14:52 +0200 Subject: [PATCH 08/16] [Tests] Fixed type hints in RelationSearchBaseIntegrationTestTrait --- ...RelationSearchBaseIntegrationTestTrait.php | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tests/integration/Core/Repository/FieldType/RelationSearchBaseIntegrationTestTrait.php b/tests/integration/Core/Repository/FieldType/RelationSearchBaseIntegrationTestTrait.php index 161799afb9..8cfa20f0e6 100644 --- a/tests/integration/Core/Repository/FieldType/RelationSearchBaseIntegrationTestTrait.php +++ b/tests/integration/Core/Repository/FieldType/RelationSearchBaseIntegrationTestTrait.php @@ -8,6 +8,7 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Content; use Ibexa\Contracts\Core\Repository\Values\Content\LocationCreateStruct; +use Ibexa\Contracts\Core\Repository\Values\Content\Relation as APIRelation; use Ibexa\Core\Repository\Values\Content\Relation; /** @@ -72,25 +73,26 @@ public function testUpdateContentRelationsProcessedCorrect() /** * Normalizes given $relations for easier comparison. * - * @param \Ibexa\Core\Repository\Values\Content\Relation[] $relations + * @param \Ibexa\Contracts\Core\Repository\Values\Content\Relation[] $relations * * @return \Ibexa\Core\Repository\Values\Content\Relation[] */ - protected function normalizeRelations(array $relations) + protected function normalizeRelations(array $relations): array { usort( $relations, - static function (Relation $a, Relation $b) { - if ($a->type == $b->type) { + static function (APIRelation $a, APIRelation $b) { + if ($a->type === $b->type) { return $a->destinationContentInfo->id < $b->destinationContentInfo->id ? 1 : -1; } return $a->type < $b->type ? 1 : -1; } ); - $normalized = array_map( - static function (Relation $relation) { - $newRelation = new Relation( + + return array_map( + static function (APIRelation $relation) { + return new Relation( [ 'id' => null, 'sourceFieldDefinitionIdentifier' => $relation->sourceFieldDefinitionIdentifier, @@ -99,13 +101,9 @@ static function (Relation $relation) { 'destinationContentInfo' => $relation->destinationContentInfo, ] ); - - return $newRelation; }, $relations ); - - return $normalized; } public function testCopyContentCopiesFieldRelations() From b106fda04390b244ebf3f162a89fdedbea8faa9c Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 10 Sep 2025 17:15:50 +0200 Subject: [PATCH 09/16] [Tests] Fixed return type hints in UI Translation VOs tests --- tests/lib/Repository/Values/Translation/MessageTest.php | 2 +- tests/lib/Repository/Values/Translation/PluralTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/lib/Repository/Values/Translation/MessageTest.php b/tests/lib/Repository/Values/Translation/MessageTest.php index 278847cb4b..757158e2e0 100644 --- a/tests/lib/Repository/Values/Translation/MessageTest.php +++ b/tests/lib/Repository/Values/Translation/MessageTest.php @@ -25,7 +25,7 @@ public function testStringable(Message $message, string $expectedString): void } /** - * @return array + * @return iterable */ public static function getDataForTestStringable(): iterable { diff --git a/tests/lib/Repository/Values/Translation/PluralTest.php b/tests/lib/Repository/Values/Translation/PluralTest.php index d0d6e57f96..b1158f0cf7 100644 --- a/tests/lib/Repository/Values/Translation/PluralTest.php +++ b/tests/lib/Repository/Values/Translation/PluralTest.php @@ -25,7 +25,7 @@ public function testStringable(Plural $message, string $expectedString): void } /** - * @return array + * @return iterable */ public static function getDataForTestStringable(): iterable { From 97cf754b70d61495416bbd46a0920b9c215fc374 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 10 Sep 2025 21:05:24 +0200 Subject: [PATCH 10/16] [Country Field Type] Improved data integrity checking when converting to/from storage values --- .../Content/FieldValue/Converter/CountryConverter.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryConverter.php index 670839dddb..733c21bcc9 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryConverter.php @@ -37,7 +37,9 @@ public static function create() */ public function toStorageValue(FieldValue $value, StorageFieldValue $storageFieldValue) { - $storageFieldValue->dataText = empty($value->data) ? '' : implode(',', $value->data); + $storageFieldValue->dataText = empty($value->data) || !is_array($value->data) + ? '' + : implode(',', $value->data); $storageFieldValue->sortKeyString = $value->sortKey; } @@ -65,7 +67,7 @@ public function toStorageFieldDefinition(FieldDefinition $fieldDef, StorageField $storageDef->dataInt1 = (int)$fieldDef->fieldTypeConstraints->fieldSettings['isMultiple']; } - $storageDef->dataText5 = $fieldDef->defaultValue->data === null + $storageDef->dataText5 = $fieldDef->defaultValue->data === null || !is_array($fieldDef->defaultValue->data) ? '' : implode(',', $fieldDef->defaultValue->data); } From 9be4b34dc999754f0501e4d8422332eaae3d8e81 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 10 Sep 2025 17:16:26 +0200 Subject: [PATCH 11/16] [PHPStan] Removed resolved issues from the baseline --- phpstan-baseline-7.4.neon | 72 --------------- phpstan-baseline.neon | 180 -------------------------------------- 2 files changed, 252 deletions(-) diff --git a/phpstan-baseline-7.4.neon b/phpstan-baseline-7.4.neon index 04ac64b05c..33547e3bc3 100644 --- a/phpstan-baseline-7.4.neon +++ b/phpstan-baseline-7.4.neon @@ -6,24 +6,6 @@ parameters: count: 1 path: src/bundle/Core/ApiLoader/StorageConnectionFactory.php - - - message: '#^Parameter \#1 \$input of function array_filter expects array, iterable\ given\.$#' - identifier: argument.type - count: 1 - path: src/bundle/Core/Command/CleanupVersionsCommand.php - - - - message: '#^Parameter \#1 \$input of function array_slice expects array, iterable\ given\.$#' - identifier: argument.type - count: 1 - path: src/bundle/Core/Command/CleanupVersionsCommand.php - - - - message: '#^Parameter \#1 \$var of function count expects array\|Countable, iterable\ given\.$#' - identifier: argument.type - count: 1 - path: src/bundle/Core/Command/CleanupVersionsCommand.php - - message: '#^Parameter \#2 \$str of function fwrite expects string, string\|false given\.$#' identifier: argument.type @@ -198,12 +180,6 @@ parameters: count: 1 path: src/lib/MVC/Symfony/Component/Serializer/AbstractPropertyWhitelistNormalizer.php - - - message: '#^Parameter \#1 \$input of function array_keys expects array, iterable\ given\.$#' - identifier: argument.type - count: 1 - path: src/lib/MVC/Symfony/FieldType/RelationList/ParameterProvider.php - - message: '#^Parameter \#1 \$arr1 of function array_merge expects array, iterable\ given\.$#' identifier: argument.type @@ -246,18 +222,6 @@ parameters: count: 1 path: src/lib/Persistence/Cache/UrlWildcardHandler.php - - - message: '#^Parameter \#2 \$pieces of function implode expects array, array\|bool\|float\|int\|string given\.$#' - identifier: argument.type - count: 1 - path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryConverter.php - - - - message: '#^Parameter \#2 \$pieces of function implode expects array, array\|float\|int\\|int\<1, max\>\|string\|true given\.$#' - identifier: argument.type - count: 1 - path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryConverter.php - - message: '#^Cannot access property \$ownerDocument on DOMElement\|false\.$#' identifier: property.nonObject @@ -360,12 +324,6 @@ parameters: count: 1 path: src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Ancestor.php - - - message: '#^Parameter \#1 \$object of method ReflectionProperty\:\:getValue\(\) expects object, object\|null given\.$#' - identifier: argument.type - count: 1 - path: tests/bundle/Core/DependencyInjection/Compiler/SlugConverterConfigurationPassTest.php - - message: '#^Parameter \#1 \$var of function count expects array\|Countable, array\|bool\|float\|int\|string\|null given\.$#' identifier: argument.type @@ -414,24 +372,6 @@ parameters: count: 1 path: tests/integration/Core/Repository/BaseTest.php - - - message: '#^Parameter \#1 \$var of function count expects array\|Countable, iterable\ given\.$#' - identifier: argument.type - count: 4 - path: tests/integration/Core/Repository/ContentServiceAuthorizationTest.php - - - - message: '#^Parameter \#1 \$array_arg of function usort expects TArray of array, iterable\ given\.$#' - identifier: argument.type - count: 2 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: '#^Parameter \#1 \$input of function array_keys expects array, iterable\ given\.$#' - identifier: argument.type - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - message: '#^Parameter \#1 \$input of function array_values expects array\, iterable\ given\.$#' identifier: argument.type @@ -450,18 +390,6 @@ parameters: count: 1 path: tests/integration/Core/Repository/ContentServiceTest.php - - - message: '#^Parameter \#1 \$var of function count expects array\|Countable, iterable\ given\.$#' - identifier: argument.type - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: '#^Parameter \#1 \$var of function count expects array\|Countable, iterable\ given\.$#' - identifier: argument.type - count: 2 - path: tests/integration/Core/Repository/ContentServiceTest.php - - message: '#^Parameter \#1 \$var of function count expects array\|Countable, iterable\ given\.$#' identifier: argument.type diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1fca190834..e6267c56ce 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -276,12 +276,6 @@ parameters: count: 1 path: src/bundle/Core/Command/RegenerateUrlAliasesCommand.php - - - message: '#^Cannot access offset int on iterable\\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/bundle/Core/Command/RegenerateUrlAliasesCommand.php - - message: '#^Method Ibexa\\Bundle\\Core\\Command\\RegenerateUrlAliasesCommand\:\:configure\(\) has no return type specified\.$#' identifier: missingType.return @@ -1080,12 +1074,6 @@ parameters: count: 1 path: src/bundle/Core/DependencyInjection/Configuration/ConfigResolver.php - - - message: '#^Offset ''function'' on array\{function\: string, line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\} in isset\(\) always exists and is not nullable\.$#' - identifier: isset.offset - count: 1 - path: src/bundle/Core/DependencyInjection/Configuration/ConfigResolver.php - - message: '#^Parameter \#2 \$haystack of function in_array expects array, array\|bool\|float\|int\|string\|null given\.$#' identifier: argument.type @@ -10290,12 +10278,6 @@ parameters: count: 1 path: src/lib/Base/Utils/DeprecationWarnerInterface.php - - - message: '#^Parameter \#1 \$locations of class Ibexa\\Contracts\\Core\\Repository\\Events\\Content\\DeleteContentEvent constructor expects array, array\|iterable\ given\.$#' - identifier: argument.type - count: 1 - path: src/lib/Event/ContentService.php - - message: '#^Method Ibexa\\Core\\Event\\TokenService\:\:getToken\(\) should return Ibexa\\Contracts\\Core\\Repository\\Values\\Token\\Token but returns Ibexa\\Contracts\\Core\\Repository\\Values\\Token\\Token\|string\.$#' identifier: return.type @@ -10734,12 +10716,6 @@ parameters: count: 1 path: src/lib/FieldType/BinaryFile/Type.php - - - message: '#^Method Ibexa\\Core\\FieldType\\BinaryFile\\Type\:\:completeValue\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: src/lib/FieldType/BinaryFile/Type.php - - message: '#^Method Ibexa\\Core\\FieldType\\BinaryFile\\Type\:\:createValue\(\) has parameter \$inputValue with no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -11898,12 +11874,6 @@ parameters: count: 1 path: src/lib/FieldType/Media/Type.php - - - message: '#^Method Ibexa\\Core\\FieldType\\Media\\Type\:\:completeValue\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: src/lib/FieldType/Media/Type.php - - message: '#^Method Ibexa\\Core\\FieldType\\Media\\Type\:\:createValue\(\) has parameter \$inputValue with no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -17616,12 +17586,6 @@ parameters: count: 1 path: src/lib/Persistence/Cache/PersistenceLogger.php - - - message: '#^Offset ''class'' might not exist on array\{function\: string, line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\}\.$#' - identifier: offsetAccess.notFound - count: 2 - path: src/lib/Persistence/Cache/PersistenceLogger.php - - message: '#^Property Ibexa\\Core\\Persistence\\Cache\\PersistenceLogger\:\:\$calls type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -18498,12 +18462,6 @@ parameters: count: 1 path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php - - - message: '#^Cannot access property \$nodeValue on \(TNode of DOMNode\)\|null\.$#' - identifier: property.nonObject - count: 1 - path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php - - message: '#^Cannot call method getAttribute\(\) on DOMElement\|null\.$#' identifier: method.nonObject @@ -33084,72 +33042,12 @@ parameters: count: 7 path: tests/integration/Core/Repository/ContentServiceTest.php - - - message: '#^Cannot access offset 0 on iterable\\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 12 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: '#^Cannot access offset 0 on iterable\\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 4 - path: tests/integration/Core/Repository/ContentServiceTest.php - - message: '#^Cannot access offset 1 on iterable\\.$#' identifier: offsetAccess.nonOffsetAccessible count: 2 path: tests/integration/Core/Repository/ContentServiceTest.php - - - message: '#^Cannot access offset 1 on iterable\\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 4 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: '#^Cannot access offset 1 on iterable\\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: '#^Cannot access offset 2 on iterable\\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: '#^Cannot access offset 3 on iterable\\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: '#^Cannot access offset 4 on iterable\\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: '#^Cannot access offset 5 on iterable\\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: '#^Cannot access offset int on iterable\\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: '#^Cannot access offset mixed on iterable\\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - message: '#^Cannot access property \$sortField on Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\|null\.$#' identifier: property.nonObject @@ -33252,12 +33150,6 @@ parameters: count: 1 path: tests/integration/Core/Repository/ContentServiceTest.php - - - message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\ContentServiceTest\:\:testAddRelation\(\) should return array\ but returns iterable\\.$#' - identifier: return.type - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\ContentServiceTest\:\:testAddRelationAddsRelationToContent\(\) has no return type specified\.$#' identifier: missingType.return @@ -33390,12 +33282,6 @@ parameters: count: 1 path: tests/integration/Core/Repository/ContentServiceTest.php - - - message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\ContentServiceTest\:\:testCreateContentDraftWithRelations\(\) should return array\ but returns iterable\\.$#' - identifier: return.type - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\ContentServiceTest\:\:testCreateContentDraftWithRelationsCreatesExpectedRelations\(\) has no return type specified\.$#' identifier: missingType.return @@ -33990,12 +33876,6 @@ parameters: count: 1 path: tests/integration/Core/Repository/ContentServiceTest.php - - - message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\ContentServiceTest\:\:testLoadVersions\(\) should return array\ but returns iterable\\.$#' - identifier: return.type - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\ContentServiceTest\:\:testLoadVersionsAfterDeletingTwoDrafts\(\) has no return type specified\.$#' identifier: missingType.return @@ -37482,18 +37362,6 @@ parameters: count: 1 path: tests/integration/Core/Repository/FieldType/RelationIntegrationTest.php - - - message: '#^Parameter \#1 \$relations of method Ibexa\\Tests\\Integration\\Core\\Repository\\FieldType\\RelationIntegrationTest\:\:normalizeRelations\(\) expects array\, array\ given\.$#' - identifier: argument.type - count: 5 - path: tests/integration/Core/Repository/FieldType/RelationIntegrationTest.php - - - - message: '#^Parameter \#1 \$relations of method Ibexa\\Tests\\Integration\\Core\\Repository\\FieldType\\RelationIntegrationTest\:\:normalizeRelations\(\) expects array\, iterable\ given\.$#' - identifier: argument.type - count: 5 - path: tests/integration/Core/Repository/FieldType/RelationIntegrationTest.php - - message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\FieldType\\RelationListIntegrationTest\:\:assertCopiedFieldDataLoadedCorrectly\(\) has no return type specified\.$#' identifier: missingType.return @@ -37602,18 +37470,6 @@ parameters: count: 1 path: tests/integration/Core/Repository/FieldType/RelationListIntegrationTest.php - - - message: '#^Parameter \#1 \$relations of method Ibexa\\Tests\\Integration\\Core\\Repository\\FieldType\\RelationListIntegrationTest\:\:normalizeRelations\(\) expects array\, array\ given\.$#' - identifier: argument.type - count: 5 - path: tests/integration/Core/Repository/FieldType/RelationListIntegrationTest.php - - - - message: '#^Parameter \#1 \$relations of method Ibexa\\Tests\\Integration\\Core\\Repository\\FieldType\\RelationListIntegrationTest\:\:normalizeRelations\(\) expects array\, iterable\ given\.$#' - identifier: argument.type - count: 5 - path: tests/integration/Core/Repository/FieldType/RelationListIntegrationTest.php - - message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\FieldType\\SearchBaseIntegrationTest\:\:assertFindResult\(\) has no return type specified\.$#' identifier: missingType.return @@ -60534,42 +60390,12 @@ parameters: count: 1 path: tests/lib/Persistence/Cache/PersistenceLoggerTest.php - - - message: '#^Method Ibexa\\Tests\\Core\\Persistence\\Cache\\PersistenceLoggerTest\:\:testGetCalls\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: tests/lib/Persistence/Cache/PersistenceLoggerTest.php - - - - message: '#^Method Ibexa\\Tests\\Core\\Persistence\\Cache\\PersistenceLoggerTest\:\:testGetCount\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: tests/lib/Persistence/Cache/PersistenceLoggerTest.php - - message: '#^Method Ibexa\\Tests\\Core\\Persistence\\Cache\\PersistenceLoggerTest\:\:testGetCountValues\(\) has no return type specified\.$#' identifier: missingType.return count: 1 path: tests/lib/Persistence/Cache/PersistenceLoggerTest.php - - - message: '#^Method Ibexa\\Tests\\Core\\Persistence\\Cache\\PersistenceLoggerTest\:\:testGetName\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: tests/lib/Persistence/Cache/PersistenceLoggerTest.php - - - - message: '#^Method Ibexa\\Tests\\Core\\Persistence\\Cache\\PersistenceLoggerTest\:\:testLogCall\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: tests/lib/Persistence/Cache/PersistenceLoggerTest.php - - - - message: '#^Result of method Ibexa\\Core\\Persistence\\Cache\\PersistenceLogger\:\:logCall\(\) \(void\) is used\.$#' - identifier: method.void - count: 1 - path: tests/lib/Persistence/Cache/PersistenceLoggerTest.php - - message: '#^Method Ibexa\\Tests\\Core\\Persistence\\Cache\\SectionHandlerTest\:\:providerForCachedLoadMethodsHit\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -63798,12 +63624,6 @@ parameters: count: 1 path: tests/lib/Persistence/Legacy/Content/MapperTest.php - - - message: '#^Possibly invalid array key type \(list\\|string\)\.$#' - identifier: offsetAccess.invalidOffset - count: 2 - path: tests/lib/Persistence/Legacy/Content/MapperTest.php - - message: '#^Property Ibexa\\Contracts\\Core\\Persistence\\Content\\CreateStruct\:\:\$name \(array\\) does not accept string\.$#' identifier: assign.propertyType From 8811c1c39b81d70488d0d4dad2b11c1390b4f3e6 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 10 Sep 2025 21:06:58 +0200 Subject: [PATCH 12/16] [PHPStan] Regenerated baseline for PHP >= 8.0 --- phpstan-baseline-gte-8.0.neon | 280 ++++++++++++++++++---------------- 1 file changed, 150 insertions(+), 130 deletions(-) diff --git a/phpstan-baseline-gte-8.0.neon b/phpstan-baseline-gte-8.0.neon index c7eda9583c..66ecc07e72 100644 --- a/phpstan-baseline-gte-8.0.neon +++ b/phpstan-baseline-gte-8.0.neon @@ -1,431 +1,451 @@ parameters: ignoreErrors: - - message: "#^Parameter \\#1 \\$array of function array_keys expects array, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + message: '#^Parameter \#1 \$array of function array_keys expects array, array\|bool\|float\|int\|string\|null given\.$#' + identifier: argument.type count: 1 path: src/bundle/Core/ApiLoader/StorageConnectionFactory.php - - message: "#^Parameter \\#1 \\$array of function array_filter expects array, iterable\\ given\\.$#" - count: 1 - path: src/bundle/Core/Command/CleanupVersionsCommand.php - - - - message: "#^Parameter \\#1 \\$array of function array_slice expects array, iterable\\ given\\.$#" - count: 1 - path: src/bundle/Core/Command/CleanupVersionsCommand.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" - count: 1 - path: src/bundle/Core/Command/CleanupVersionsCommand.php - - - - message: "#^Parameter \\#2 \\$data of function fwrite expects string, string\\|false given\\.$#" + message: '#^Parameter \#2 \$data of function fwrite expects string, string\|false given\.$#' + identifier: argument.type count: 1 path: src/bundle/Core/Command/ResizeOriginalImagesCommand.php - - message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, Ibexa\\\\Contracts\\\\Core\\\\SiteAccess\\\\ConfigResolverInterface given\\.$#" + message: '#^Parameter \#2 \.\.\.\$arrays of function array_merge expects array, Ibexa\\Contracts\\Core\\SiteAccess\\ConfigResolverInterface given\.$#' + identifier: argument.type count: 1 path: src/bundle/Core/DependencyInjection/Configuration/ChainConfigResolver.php - - message: "#^Parameter \\#1 \\$string of function strtolower expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$string of function strtolower expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/bundle/Core/DependencyInjection/Configuration/ConfigResolver.php - - message: "#^Parameter \\#1 \\$array of function array_shift expects array, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + message: '#^Parameter \#1 \$array of function array_shift expects array, array\|bool\|float\|int\|string\|null given\.$#' + identifier: argument.type count: 1 path: src/bundle/Core/DependencyInjection/Configuration/Parser/Languages.php - - message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, array\|bool\|float\|int\|string\|null given\.$#' + identifier: argument.type count: 1 path: src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/Contextualizer.php - - message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, array\|bool\|float\|int\|string\|null given\.$#' + identifier: argument.type count: 1 path: src/bundle/Core/DependencyInjection/IbexaCoreExtension.php - - message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, int\\<0, max\\>\\|false given\\.$#" + message: '#^Parameter \#3 \$length of function substr expects int\|null, int\<0, max\>\|false given\.$#' + identifier: argument.type count: 1 path: src/bundle/Core/Features/Context/ContentPreviewContext.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, iterable\ given\.$#' + identifier: argument.type count: 1 path: src/bundle/Core/Features/Context/UserContext.php - - message: "#^Parameter \\#2 \\$data of function fwrite expects string, string\\|false given\\.$#" + message: '#^Parameter \#2 \$data of function fwrite expects string, string\|false given\.$#' + identifier: argument.type count: 1 path: src/bundle/Core/Imagine/IORepositoryResolver.php - - message: "#^Method Ibexa\\\\Bundle\\\\Core\\\\URLChecker\\\\Handler\\\\HTTPHandler\\:\\:createCurlHandlerForUrl\\(\\) should return resource but returns \\(CurlHandle\\|false\\)\\.$#" + message: '#^Method Ibexa\\Bundle\\Core\\URLChecker\\Handler\\HTTPHandler\:\:createCurlHandlerForUrl\(\) should return resource but returns \(CurlHandle\|false\)\.$#' + identifier: return.type count: 1 path: src/bundle/Core/URLChecker/Handler/HTTPHandler.php - - message: "#^Parameter \\#1 \\$handle of function curl_getinfo expects CurlHandle, resource given\\.$#" + message: '#^Parameter \#1 \$handle of function curl_getinfo expects CurlHandle, resource given\.$#' + identifier: argument.type count: 1 path: src/bundle/Core/URLChecker/Handler/HTTPHandler.php - - message: "#^Parameter \\#2 \\$handle of function curl_multi_add_handle expects CurlHandle, resource given\\.$#" + message: '#^Parameter \#2 \$handle of function curl_multi_add_handle expects CurlHandle, resource given\.$#' + identifier: argument.type count: 2 path: src/bundle/Core/URLChecker/Handler/HTTPHandler.php - - message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#" + message: '#^Parameter \#1 \$stream of function fclose expects resource, resource\|false given\.$#' + identifier: argument.type count: 1 path: src/bundle/IO/BinaryStreamResponse.php - - message: "#^Parameter \\#2 \\$to of function stream_copy_to_stream expects resource, resource\\|false given\\.$#" + message: '#^Parameter \#2 \$to of function stream_copy_to_stream expects resource, resource\|false given\.$#' + identifier: argument.type count: 1 path: src/bundle/IO/BinaryStreamResponse.php - - message: "#^Parameter \\#3 \\$limit of class LimitIterator constructor expects int, int\\|null given\\.$#" + message: '#^Parameter \#3 \$limit of class LimitIterator constructor expects int, int\|null given\.$#' + identifier: argument.type count: 1 path: src/bundle/IO/Migration/FileLister/BinaryFileLister.php - - message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, int\\<0, max\\>\\|false given\\.$#" + message: '#^Parameter \#3 \$length of function substr expects int\|null, int\<0, max\>\|false given\.$#' + identifier: argument.type count: 1 path: src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageFileRowReader.php - - message: "#^Parameter \\#3 \\$limit of class LimitIterator constructor expects int, int\\|null given\\.$#" + message: '#^Parameter \#3 \$limit of class LimitIterator constructor expects int, int\|null given\.$#' + identifier: argument.type count: 1 path: src/bundle/IO/Migration/FileLister/ImageFileLister.php - - message: "#^Parameter \\#1 \\$array of function array_keys expects array, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + message: '#^Parameter \#1 \$array of function array_keys expects array, array\|bool\|float\|int\|string\|null given\.$#' + identifier: argument.type count: 1 path: src/bundle/LegacySearchEngine/ApiLoader/ConnectionFactory.php - - message: "#^Parameter \\#1 \\$object_or_class of function is_a expects object\\|string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$object_or_class of function is_a expects object\|string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/lib/Base/Container/Compiler/FieldTypeRegistryPass.php - - message: "#^Parameter \\#1 \\$object_or_class of function is_subclass_of expects object\\|string, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + message: '#^Parameter \#1 \$object_or_class of function is_subclass_of expects object\|string, array\|bool\|float\|int\|string\|null given\.$#' + identifier: argument.type count: 1 path: src/lib/Base/Container/Compiler/Storage/ExternalStorageRegistryPass.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, array\|bool\|float\|int\|string\|null given\.$#' + identifier: argument.type count: 1 path: src/lib/FieldType/Author/SearchField.php - - message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, int\\<0, max\\>\\|false given\\.$#" + message: '#^Parameter \#3 \$length of function substr expects int\|null, int\<0, max\>\|false given\.$#' + identifier: argument.type count: 1 path: src/lib/FieldType/BinaryBase/BinaryBaseStorage/Gateway/DoctrineStorage.php - - message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, int\\<0, max\\>\\|false given\\.$#" + message: '#^Parameter \#3 \$length of function substr expects int\|null, int\<0, max\>\|false given\.$#' + identifier: argument.type count: 1 path: src/lib/FieldType/BinaryBase/PathGenerator/LegacyPathGenerator.php - - message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, array\\|bool\\|float\\|int\\|string given\\.$#" + message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, array\|bool\|float\|int\|string given\.$#' + identifier: argument.type count: 1 path: src/lib/FieldType/Image/ImageStorage.php - - message: "#^Parameter \\#1 \\$array of function array_flip expects array\\, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + message: '#^Parameter \#1 \$array of function array_flip expects array\, array\|bool\|float\|int\|string\|null given\.$#' + identifier: argument.type count: 1 path: src/lib/FieldType/Selection/SearchField.php - - message: "#^Parameter \\#1 \\$string of function mb_substr expects string, string\\|false given\\.$#" + message: '#^Parameter \#1 \$string of function mb_substr expects string, string\|false given\.$#' + identifier: argument.type count: 1 path: src/lib/FieldType/TextBlock/SearchField.php - - message: "#^Parameter \\#1 \\$string of function mb_substr expects string, string\\|false given\\.$#" + message: '#^Parameter \#1 \$string of function mb_substr expects string, string\|false given\.$#' + identifier: argument.type count: 1 path: src/lib/FieldType/TextBlock/Type.php - - message: "#^Parameter \\#1 \\$array of function array_keys expects array, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$array of function array_keys expects array, iterable\ given\.$#' + identifier: argument.type count: 1 path: src/lib/Limitation/LanguageLimitationType.php - - message: "#^Parameter \\#1 \\$array of function array_keys expects array, iterable\\ given\\.$#" - count: 1 - path: src/lib/MVC/Symfony/FieldType/RelationList/ParameterProvider.php - - - - message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, iterable\\ given\\.$#" + message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, iterable\ given\.$#' + identifier: argument.type count: 1 path: src/lib/MVC/Symfony/Matcher/ContentBased/UrlAlias.php - - message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, iterable\\ given\\.$#" + message: '#^Parameter \#2 \.\.\.\$arrays of function array_merge expects array, iterable\ given\.$#' + identifier: argument.type count: 1 path: src/lib/MVC/Symfony/Matcher/ContentBased/UrlAlias.php - - message: "#^Parameter \\#2 \\$array of function implode expects array\\|null, array\\|bool\\|float\\|int\\|string given\\.$#" - count: 1 - path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryConverter.php - - - - message: "#^Parameter \\#2 \\$array of function implode expects array\\|null, array\\|float\\|int\\\\|int\\<1, max\\>\\|string\\|true given\\.$#" - count: 1 - path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryConverter.php - - - - message: "#^Parameter \\#1 \\$array of function array_keys expects array, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$array of function array_keys expects array, iterable\ given\.$#' + identifier: argument.type count: 2 path: src/lib/Persistence/Legacy/Content/Language/MaskGenerator.php - - message: "#^Parameter \\#1 \\$string of function strlen expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$string of function strlen expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/lib/Persistence/TransformationProcessor/DefinitionBased/Parser.php - - message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$string of function substr expects string, string\|null given\.$#' + identifier: argument.type count: 2 path: src/lib/Persistence/TransformationProcessor/DefinitionBased/Parser.php - - message: "#^Parameter \\#2 \\$subject of function preg_match expects string, string\\|null given\\.$#" + message: '#^Parameter \#2 \$subject of function preg_match expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/lib/Persistence/TransformationProcessor/DefinitionBased/Parser.php - - message: "#^Parameter \\#1 \\$codepoint of function chr expects int, float\\|int given\\.$#" + message: '#^Parameter \#1 \$codepoint of function chr expects int, float\|int given\.$#' + identifier: argument.type count: 1 path: src/lib/Persistence/TransformationProcessor/PcreCompiler.php - - message: "#^Parameter \\#1 \\$hex_string of function hexdec expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$hex_string of function hexdec expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/lib/Persistence/TransformationProcessor/PcreCompiler.php - - message: "#^Parameter \\#1 \\$string of function md5 expects string, string\\|false given\\.$#" + message: '#^Parameter \#1 \$string of function md5 expects string, string\|false given\.$#' + identifier: argument.type count: 4 path: src/lib/Repository/Mapper/ContentMapper.php - - message: "#^Parameter \\#1 \\$callback of function spl_autoload_register expects \\(callable\\(string\\)\\: void\\)\\|null, ProxyManager\\\\Autoloader\\\\AutoloaderInterface given\\.$#" + message: '#^Parameter \#1 \$callback of function spl_autoload_register expects \(callable\(string\)\: void\)\|null, ProxyManager\\Autoloader\\AutoloaderInterface given\.$#' + identifier: argument.type count: 1 path: src/lib/Repository/ProxyFactory/ProxyGenerator.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, iterable\ given\.$#' + identifier: argument.type count: 1 path: src/lib/Repository/UserService.php - - message: "#^Parameter \\#1 \\$array of function array_keys expects array, string given\\.$#" + message: '#^Parameter \#1 \$array of function array_keys expects array, string given\.$#' + identifier: argument.type count: 3 path: src/lib/Search/Common/FieldNameResolver.php - - message: "#^Parameter \\#1 \\$string of function trim expects string, bool\\|float\\|int\\|string given\\.$#" + message: '#^Parameter \#1 \$string of function trim expects string, bool\|float\|int\|string given\.$#' + identifier: argument.type count: 1 path: src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Ancestor.php - - message: "#^Parameter \\#1 \\$string of function trim expects string, bool\\|float\\|int\\|string given\\.$#" + message: '#^Parameter \#1 \$string of function trim expects string, bool\|float\|int\|string given\.$#' + identifier: argument.type count: 1 path: src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Ancestor.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, array\|bool\|float\|int\|string\|null given\.$#' + identifier: argument.type count: 1 path: tests/bundle/Core/DependencyInjection/IbexaCoreExtensionTest.php - - message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge_recursive expects array, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + message: '#^Parameter \#2 \.\.\.\$arrays of function array_merge_recursive expects array, array\|bool\|float\|int\|string\|null given\.$#' + identifier: argument.type count: 1 path: tests/bundle/Core/DependencyInjection/IbexaCoreExtensionTest.php - - message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$string of function trim expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: tests/bundle/Core/EventListener/BackwardCompatibleCommandListenerTest.php - - message: "#^Parameter \\#2 \\$offset of function substr expects int, int\\<1, max\\>\\|false given\\.$#" + message: '#^Parameter \#2 \$offset of function substr expects int, int\<1, max\>\|false given\.$#' + identifier: argument.type count: 1 path: tests/bundle/Core/EventListener/SiteAccessListenerTest.php - - message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, int\\<0, max\\>\\|false given\\.$#" + message: '#^Parameter \#3 \$length of function substr expects int\|null, int\<0, max\>\|false given\.$#' + identifier: argument.type count: 1 path: tests/bundle/Core/Routing/DefaultRouterTest.php - - message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#" + message: '#^Parameter \#1 \$stream of function fclose expects resource, resource\|false given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/IO/BinarydataHandler/FlysystemTest.php - - message: "#^Parameter \\#1 \\$string1 of function strcmp expects string, bool\\|float\\|int\\|string given\\.$#" + message: '#^Parameter \#1 \$string1 of function strcmp expects string, bool\|float\|int\|string given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/Repository/BaseTest.php - - message: "#^Parameter \\#2 \\$string2 of function strcmp expects string, bool\\|float\\|int\\|string given\\.$#" + message: '#^Parameter \#2 \$string2 of function strcmp expects string, bool\|float\|int\|string given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/Repository/BaseTest.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" - count: 4 - path: tests/integration/Core/Repository/ContentServiceAuthorizationTest.php - - - - message: "#^Parameter \\#1 \\$array of function array_keys expects array, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$array of function array_values expects array\, iterable\ given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/Repository/ContentServiceTest.php - - message: "#^Parameter \\#1 \\$array of function array_values expects array\\, iterable\\ given\\.$#" - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: "#^Parameter \\#1 \\$array of function usort expects TArray of array, iterable\\ given\\.$#" - count: 2 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: "#^Parameter \\#1 \\$string of function md5 expects string, float given\\.$#" + message: '#^Parameter \#1 \$string of function md5 expects string, float given\.$#' + identifier: argument.type count: 3 path: tests/integration/Core/Repository/ContentServiceTest.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" - count: 1 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, iterable\ given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/Repository/ContentServiceTest.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" - count: 2 - path: tests/integration/Core/Repository/ContentServiceTest.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, iterable\ given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/Repository/ContentTypeServiceTest.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, iterable\ given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/Repository/LanguageServiceMaximumSupportedLanguagesTest.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, iterable\ given\.$#' + identifier: argument.type count: 2 path: tests/integration/Core/Repository/LanguageServiceTest.php - - message: "#^Parameter \\#1 \\$array of function array_filter expects array, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$array of function array_filter expects array, iterable\ given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/Repository/LocationServiceTest.php - - message: "#^Parameter \\#1 \\$array of function array_keys expects array, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$array of function array_keys expects array, iterable\ given\.$#' + identifier: argument.type count: 3 path: tests/integration/Core/Repository/LocationServiceTest.php - - message: "#^Parameter \\#1 \\$array of function array_filter expects array, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$array of function array_filter expects array, iterable\ given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/Repository/PermissionResolverTest.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, iterable\ given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/Repository/Regression/EZP21798Test.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, iterable\ given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/Repository/RoleServiceTest.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, iterable\ given\.$#' + identifier: argument.type count: 3 path: tests/integration/Core/Repository/RoleServiceTest.php - - message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, iterable\\ given\\.$#" + message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, iterable\ given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/Repository/RoleServiceTest.php - - message: "#^Parameter \\#1 \\$class of class ReflectionProperty constructor expects object\\|string, class\\-string\\|false given\\.$#" + message: '#^Parameter \#1 \$class of class ReflectionProperty constructor expects object\|string, class\-string\|false given\.$#' + identifier: argument.type count: 4 path: tests/integration/Core/Repository/SearchServiceLocationTest.php - - message: "#^Parameter \\#1 \\$class of class ReflectionProperty constructor expects object\\|string, class\\-string\\|false given\\.$#" + message: '#^Parameter \#1 \$class of class ReflectionProperty constructor expects object\|string, class\-string\|false given\.$#' + identifier: argument.type count: 4 path: tests/integration/Core/Repository/SearchServiceTest.php - - message: "#^Parameter \\#1 \\$string of function md5 expects string, int\\<1, max\\> given\\.$#" + message: '#^Parameter \#1 \$string of function md5 expects string, int\<1, max\> given\.$#' + identifier: argument.type count: 1 path: tests/integration/Core/Repository/Values/User/Limitation/BaseLimitationTest.php - - message: "#^Parameter \\#1 \\$string of function md5 expects string, float given\\.$#" + message: '#^Parameter \#1 \$string of function md5 expects string, float given\.$#' + identifier: argument.type count: 1 path: tests/lib/MVC/Symfony/Security/UserWrappedTest.php - - message: "#^Parameter \\#1 \\$callback of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{mixed, string\\} given\\.$#" + message: '#^Parameter \#1 \$callback of function call_user_func_array expects callable\(\)\: mixed, array\{mixed, string\} given\.$#' + identifier: argument.type count: 3 path: tests/lib/Persistence/Cache/AbstractCacheHandlerTest.php - - message: "#^Parameter \\#1 \\$callback of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{mixed, string\\} given\\.$#" + message: '#^Parameter \#1 \$callback of function call_user_func_array expects callable\(\)\: mixed, array\{mixed, string\} given\.$#' + identifier: argument.type count: 3 path: tests/lib/Persistence/Cache/AbstractInMemoryCacheHandlerTest.php - - message: "#^Parameter \\#1 \\$callback of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{mixed, 'publish'\\} given\\.$#" + message: '#^Parameter \#1 \$callback of function call_user_func_array expects callable\(\)\: mixed, array\{mixed, ''publish''\} given\.$#' + identifier: argument.type count: 1 path: tests/lib/Persistence/Cache/ContentTypeHandlerTest.php - - message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, iterable given\\.$#" + message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, iterable given\.$#' + identifier: argument.type count: 1 path: tests/lib/Persistence/Legacy/Filter/BaseCriterionVisitorQueryBuilderTestCase.php - - message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, iterable\\ given\\.$#" + message: '#^Parameter \#2 \.\.\.\$arrays of function array_merge expects array, iterable\ given\.$#' + identifier: argument.type count: 1 path: tests/lib/Persistence/Legacy/Filter/BaseCriterionVisitorQueryBuilderTestCase.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\ given\\.$#" + message: '#^Parameter \#1 \$value of function count expects array\|Countable, iterable\ given\.$#' + identifier: argument.type count: 12 path: tests/lib/Repository/Service/Mock/UrlAliasTest.php - - message: "#^Parameter \\#1 \\$array of function key expects array\\|object, string given\\.$#" + message: '#^Parameter \#1 \$array of function key expects array\|object, string given\.$#' + identifier: argument.type count: 4 path: tests/lib/Search/FieldNameResolverTest.php From 98a46dd6fc280355a30893d844c6ea7d011377ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Mon, 8 Sep 2025 13:21:37 +0200 Subject: [PATCH 13/16] IBX-10494: Included Postgres 18 on CI --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cb276976c9..dc439fa28b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -78,7 +78,7 @@ jobs: needs: tests services: postgres: - image: postgres:14 + image: postgres:18rc1 ports: - 5432 env: From a717539e1197ae7b875eb7b4473438199be20bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Tue, 9 Sep 2025 16:10:25 +0200 Subject: [PATCH 14/16] [tmp] io method sync --- .github/workflows/ci.yaml | 34 +++++++++++++++++-------------- docker-compose.yml | 19 +++++++++++++++++ docker/postgres18-sync/Dockerfile | 5 +++++ 3 files changed, 43 insertions(+), 15 deletions(-) create mode 100644 docker-compose.yml create mode 100644 docker/postgres18-sync/Dockerfile diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dc439fa28b..b9c31af3de 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -76,20 +76,6 @@ jobs: integration-tests-postgres: name: PostgreSQL integration tests needs: tests - services: - postgres: - image: postgres:18rc1 - ports: - - 5432 - env: - POSTGRES_PASSWORD: postgres - POSTGRES_DB: testdb - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - --tmpfs /var/lib/postgres runs-on: "ubuntu-24.04" timeout-minutes: 60 @@ -102,7 +88,25 @@ jobs: - '8.1' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and start Postgres (io_method=sync) with Docker Compose + run: | + docker compose -f docker-compose.yml up -d --build postgres + + - name: Wait for Postgres to be healthy + run: | + for i in {1..10}; do + if docker exec postgres18rc1-sync pg_isready -U postgres; then + exit 0 + fi + echo "Waiting for Postgres..." + sleep 5 + done + exit 1 - name: Setup PHP Action uses: shivammathur/setup-php@v2 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..502b9c7829 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +#version: "3.8" + +services: + postgres: + build: + context: ./docker/postgres18-sync + container_name: postgres18rc1-sync + environment: + POSTGRES_PASSWORD: postgres + POSTGRES_DB: testdb + ports: + - "5432:5432" + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 10s + timeout: 5s + retries: 5 + tmpfs: + - /var/lib/postgresql diff --git a/docker/postgres18-sync/Dockerfile b/docker/postgres18-sync/Dockerfile new file mode 100644 index 0000000000..7c40eb98b6 --- /dev/null +++ b/docker/postgres18-sync/Dockerfile @@ -0,0 +1,5 @@ +# Start from the official PostgreSQL 18 RC1 image +FROM postgres:18rc1 + +# Override the default CMD so that io_method=sync is always enabled +CMD ["postgres", "-c", "io_method=sync"] From 5a8ea89cd967beb0162f3623d1bfc372d14fcdf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Wed, 10 Sep 2025 15:59:37 +0200 Subject: [PATCH 15/16] [tmp] skip scan off --- .github/workflows/ci.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b9c31af3de..628e9beac2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -108,6 +108,12 @@ jobs: done exit 1 + - name: Force disable skip scan in Postgres + run: docker exec postgres18rc1-sync psql -U postgres -d testdb -c "ALTER SYSTEM SET enable_skipscan = off;" + + - name: Restart Postgres + run: docker restart postgres18rc1-sync + - name: Setup PHP Action uses: shivammathur/setup-php@v2 with: From c85a66b1d5cfd4916f0a8ee7266b42194c704a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Thu, 11 Sep 2025 14:27:17 +0200 Subject: [PATCH 16/16] [tmp] bitmap scan off --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 628e9beac2..1168896d9e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -108,8 +108,8 @@ jobs: done exit 1 - - name: Force disable skip scan in Postgres - run: docker exec postgres18rc1-sync psql -U postgres -d testdb -c "ALTER SYSTEM SET enable_skipscan = off;" + - name: Force disable bitmap scan in Postgres + run: docker exec postgres18rc1-sync psql -U postgres -d testdb -c "ALTER SYSTEM SET enable_bitmapscan = off;" - name: Restart Postgres run: docker restart postgres18rc1-sync