Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 157 additions & 13 deletions phpstan-baseline.neon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expectation remark: after addressing the feedback we expect here not to have any new issues, only removals.

If something unrelated to your changes pops up after rebasing onto main, please let me know. We address such issues regularly as they occur quite often.

Original file line number Diff line number Diff line change
Expand Up @@ -6492,6 +6492,12 @@ parameters:
count: 1
path: src/contracts/Persistence/Content/VersionInfo.php

-
message: '#^PHPDoc tag @param references unknown parameter\: \$limit$#'
identifier: parameter.notFound
count: 1
path: src/contracts/Persistence/Filter/Content/Handler.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Persistence\\Filter\\Doctrine\\FilteringQueryBuilder\:\:buildOperatorBasedCriterionConstraint\(\) has parameter \$criterionValue with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down Expand Up @@ -6522,6 +6528,12 @@ parameters:
count: 1
path: src/contracts/Persistence/Filter/LazyListIterator.php

-
message: '#^PHPDoc tag @param references unknown parameter\: \$limit$#'
identifier: parameter.notFound
count: 1
path: src/contracts/Persistence/Filter/Location/Handler.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Persistence\\Handler\:\:beginTransaction\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -6678,6 +6690,18 @@ parameters:
count: 1
path: src/contracts/Repository/ContentService.php

-
message: '#^PHPDoc tag @param references unknown parameter\: \$limit$#'
identifier: parameter.notFound
count: 1
path: src/contracts/Repository/ContentService.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\ContentService\:\:count\(\) invoked with 3 parameters, 1\-2 required\.$#'
identifier: arguments.count
count: 1
path: src/contracts/Repository/Decorator/ContentServiceDecorator.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\Decorator\\ContentServiceDecorator\:\:validate\(\) has parameter \$context with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand All @@ -6690,12 +6714,42 @@ parameters:
count: 1
path: src/contracts/Repository/Decorator/ContentServiceDecorator.php

-
message: '#^PHPDoc tag @param references unknown parameter\: \$limit$#'
identifier: parameter.notFound
count: 1
path: src/contracts/Repository/Decorator/ContentServiceDecorator.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\Decorator\\LocationServiceDecorator\:\:loadLocationList\(\) has parameter \$locationIds with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/contracts/Repository/Decorator/LocationServiceDecorator.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:count\(\) invoked with 3 parameters, 1\-2 required\.$#'
identifier: arguments.count
count: 1
path: src/contracts/Repository/Decorator/LocationServiceDecorator.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:getLocationChildCount\(\) invoked with 2 parameters, 1 required\.$#'
identifier: arguments.count
count: 1
path: src/contracts/Repository/Decorator/LocationServiceDecorator.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:getSubtreeSize\(\) invoked with 2 parameters, 1 required\.$#'
identifier: arguments.count
count: 1
path: src/contracts/Repository/Decorator/LocationServiceDecorator.php

-
message: '#^PHPDoc tag @param references unknown parameter\: \$limit$#'
identifier: parameter.notFound
count: 3
path: src/contracts/Repository/Decorator/LocationServiceDecorator.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\Decorator\\SearchServiceDecorator\:\:suggest\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -8280,6 +8334,12 @@ parameters:
count: 1
path: src/contracts/Repository/LocationService.php

-
message: '#^PHPDoc tag @param references unknown parameter\: \$limit$#'
identifier: parameter.notFound
count: 3
path: src/contracts/Repository/LocationService.php

-
message: '#^PHPDoc tag @param for parameter \$objectStateGroupId with type mixed is not subtype of native type int\.$#'
identifier: parameter.phpDocType
Expand Down Expand Up @@ -17478,6 +17538,12 @@ parameters:
count: 1
path: src/lib/Persistence/Cache/LocationHandler.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Persistence\\Content\\Location\\Handler\:\:getSubtreeSize\(\) invoked with 2 parameters, 1 required\.$#'
identifier: arguments.count
count: 1
path: src/lib/Persistence/Cache/LocationHandler.php

-
message: '#^Method Ibexa\\Core\\Persistence\\Cache\\LocationHandler\:\:changeMainLocation\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -24234,6 +24300,12 @@ parameters:
count: 1
path: src/lib/Repository/ContentService.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Persistence\\Filter\\Content\\Handler\:\:count\(\) invoked with 2 parameters, 1 required\.$#'
identifier: arguments.count
count: 1
path: src/lib/Repository/ContentService.php

-
message: '#^Method Ibexa\\Core\\Repository\\ContentService\:\:__construct\(\) has parameter \$settings with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down Expand Up @@ -24294,6 +24366,12 @@ parameters:
count: 1
path: src/lib/Repository/ContentService.php

-
message: '#^PHPDoc tag @param references unknown parameter\: \$limit$#'
identifier: parameter.notFound
count: 1
path: src/lib/Repository/ContentService.php

-
message: '#^PHPDoc tag @var has invalid value \(\$content \\Ibexa\\Core\\Repository\\Values\\Content\\Content\)\: Unexpected token "\$content", expected type at offset 9 on line 1$#'
identifier: phpDoc.parseError
Expand Down Expand Up @@ -24552,12 +24630,24 @@ parameters:
count: 1
path: src/lib/Repository/LocationService.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Persistence\\Content\\Location\\Handler\:\:getSubtreeSize\(\) invoked with 2 parameters, 1 required\.$#'
identifier: arguments.count
count: 1
path: src/lib/Repository/LocationService.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Persistence\\Content\\UrlAlias\\Handler\:\:publishUrlAliasForLocation\(\) invoked with 6 parameters, 4\-5 required\.$#'
identifier: arguments.count
count: 1
path: src/lib/Repository/LocationService.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Persistence\\Filter\\Location\\Handler\:\:count\(\) invoked with 2 parameters, 1 required\.$#'
identifier: arguments.count
count: 1
path: src/lib/Repository/LocationService.php

-
message: '#^Method Ibexa\\Core\\Repository\\LocationService\:\:__construct\(\) has parameter \$settings with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand All @@ -24570,6 +24660,12 @@ parameters:
count: 1
path: src/lib/Repository/LocationService.php

-
message: '#^PHPDoc tag @param references unknown parameter\: \$limit$#'
identifier: parameter.notFound
count: 2
path: src/lib/Repository/LocationService.php

-
message: '#^Property Ibexa\\Core\\Repository\\LocationService\:\:\$repository \(Ibexa\\Core\\Repository\\Repository\) does not accept Ibexa\\Contracts\\Core\\Repository\\Repository\.$#'
identifier: assign.propertyType
Expand Down Expand Up @@ -25512,6 +25608,12 @@ parameters:
count: 1
path: src/lib/Repository/SettingService.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\ContentService\:\:count\(\) invoked with 3 parameters, 1\-2 required\.$#'
identifier: arguments.count
count: 1
path: src/lib/Repository/SiteAccessAware/ContentService.php

-
message: '#^Method Ibexa\\Core\\Repository\\SiteAccessAware\\ContentService\:\:validate\(\) has parameter \$context with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand All @@ -25524,6 +25626,12 @@ parameters:
count: 1
path: src/lib/Repository/SiteAccessAware/ContentService.php

-
message: '#^PHPDoc tag @param references unknown parameter\: \$limit$#'
identifier: parameter.notFound
count: 1
path: src/lib/Repository/SiteAccessAware/ContentService.php

-
message: '#^Method Ibexa\\Core\\Repository\\SiteAccessAware\\Language\\AbstractLanguageResolver\:\:getPrioritizedLanguages\(\) has parameter \$forcedLanguages with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand All @@ -25542,12 +25650,36 @@ parameters:
count: 1
path: src/lib/Repository/SiteAccessAware/Language/LanguageResolver.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:count\(\) invoked with 3 parameters, 1\-2 required\.$#'
identifier: arguments.count
count: 1
path: src/lib/Repository/SiteAccessAware/LocationService.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:getLocationChildCount\(\) invoked with 2 parameters, 1 required\.$#'
identifier: arguments.count
count: 1
path: src/lib/Repository/SiteAccessAware/LocationService.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:getSubtreeSize\(\) invoked with 2 parameters, 1 required\.$#'
identifier: arguments.count
count: 1
path: src/lib/Repository/SiteAccessAware/LocationService.php

-
message: '#^Method Ibexa\\Core\\Repository\\SiteAccessAware\\LocationService\:\:loadLocationList\(\) has parameter \$locationIds with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/lib/Repository/SiteAccessAware/LocationService.php

-
message: '#^PHPDoc tag @param references unknown parameter\: \$limit$#'
identifier: parameter.notFound
count: 2
path: src/lib/Repository/SiteAccessAware/LocationService.php

-
message: '#^Property Ibexa\\Core\\Repository\\SiteAccessAware\\Repository\:\:\$notificationService \(Ibexa\\Core\\Repository\\NotificationService\) does not accept Ibexa\\Core\\Repository\\SiteAccessAware\\NotificationService\.$#'
identifier: assign.propertyType
Expand Down Expand Up @@ -41823,7 +41955,7 @@ parameters:
-
message: '#^Cannot access property \$id on Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\|null\.$#'
identifier: property.nonObject
count: 11
count: 9
path: tests/integration/Core/Repository/LocationServiceTest.php

-
Expand All @@ -41832,6 +41964,18 @@ parameters:
count: 2
path: tests/integration/Core/Repository/LocationServiceTest.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:getLocationChildCount\(\) invoked with 2 parameters, 1 required\.$#'
identifier: arguments.count
count: 1
path: tests/integration/Core/Repository/LocationServiceTest.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:getSubtreeSize\(\) invoked with 2 parameters, 1 required\.$#'
identifier: arguments.count
count: 2
path: tests/integration/Core/Repository/LocationServiceTest.php

-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LocationServiceTest\:\:assertAliasesBeforeCopy\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -42030,12 +42174,6 @@ parameters:
count: 1
path: tests/integration/Core/Repository/LocationServiceTest.php

-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LocationServiceTest\:\:testGetSubtreeSize\(\) should return Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location but returns Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\|null\.$#'
identifier: return.type
count: 1
path: tests/integration/Core/Repository/LocationServiceTest.php

-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LocationServiceTest\:\:testHideLocation\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -42300,12 +42438,6 @@ parameters:
count: 1
path: tests/integration/Core/Repository/LocationServiceTest.php

-
message: '#^Parameter \#1 \$location of method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:getSubtreeSize\(\) expects Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location, Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\|null given\.$#'
identifier: argument.type
count: 2
path: tests/integration/Core/Repository/LocationServiceTest.php

-
message: '#^Parameter \#1 \$location of method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:moveSubtree\(\) expects Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location, Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\|null given\.$#'
identifier: argument.type
Expand Down Expand Up @@ -67170,6 +67302,12 @@ parameters:
count: 1
path: tests/lib/Persistence/Legacy/Filter/CriterionQueryBuilder/LogicalOperatorQueryBuilderQueryBuilderTest.php

-
message: '#^Parameter \#3 \$limit of method Ibexa\\Core\\Persistence\\Legacy\\Filter\\Query\\LimitedCountQueryBuilder\:\:wrap\(\) expects int\<1, max\>\|null, 0 given\.$#'
identifier: argument.type
count: 1
path: tests/lib/Persistence/Legacy/Filter/Query/LimitedCountQueryBuilderTest.php

-
message: '#^Call to an undefined method Ibexa\\Contracts\\Core\\Container\:\:get\(\)\.$#'
identifier: method.notFound
Expand Down Expand Up @@ -68970,6 +69108,12 @@ parameters:
count: 1
path: tests/lib/Repository/Decorator/LanguageServiceDecoratorTest.php

-
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:getLocationChildCount\(\) invoked with 2 parameters, 1 required\.$#'
identifier: arguments.count
count: 1
path: tests/lib/Repository/Decorator/LocationServiceDecoratorTest.php

-
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Decorator\\LocationServiceDecoratorTest\:\:testCopySubtreeDecorator\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, as a consequence of what @konradoboza mentioned earlier, we don't need to introduce here an extra interface.

Explanation: Repository services do not undergo SPI [1] Backwards compatibility promise. This means that we only promise BC on consumption.

In the past, throughout the life-cycle of eZ Platform 1.x, 2.x, Ibexa 3.x, 4.x, we've added methods and optional arguments to methods on both API and persistence level. Persistence layer is even explicitly documented as not frozen in README.md. The reason is maintenance and stability - technical issues (like the one you've experienced with a proxy). We support extending only classes and interfaces which have been explicitly documented in the Ibexa Developer Documentation for that purpose, e.g., field type classes.

Doing this in any other way would make very hard to add new features to the Product.


[1] In this context - a Service Provider Interface - class/interface meant for extending. Treating everything as SPI seems to be a default BC policy for Symfony. We approach this a bit differently.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

/**
* @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\Contracts\Core\Future\Repository;

use Ibexa\Contracts\Core\Repository\ContentService;
use Ibexa\Contracts\Core\Repository\Values\Filter\Filter;

/**
* @internal Future version of ContentService to be released in Ibexa Core 5.0. Used to force value proxies to generate correct types. For internal use only.
*/
interface FutureContentService extends ContentService
{
/**
* {@inheritDoc}
*/
public function count(Filter $filter, ?array $languages = null, ?int $limit = null): int;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comment here.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/**
* @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\Contracts\Core\Future\Repository;

use Ibexa\Contracts\Core\Repository\LocationService;
use Ibexa\Contracts\Core\Repository\Values\Content\Location;
use Ibexa\Contracts\Core\Repository\Values\Filter\Filter;

/**
* @internal Future version of LocationService to be released in Ibexa Core 5.0. Used to force value proxies to generate correct types. For internal use only.
*/
interface FutureLocationService extends LocationService
{
/**
* {@inheritDoc}
*/
public function getLocationChildCount(Location $location, ?int $limit = null): int;

/**
* {@inheritDoc}
*/
public function getSubtreeSize(Location $location, ?int $limit = null): int;

/**
* {@inheritDoc}
*/
public function count(Filter $filter, ?array $languages = null, ?int $limit = null): int;
}
6 changes: 5 additions & 1 deletion src/contracts/Persistence/Content/Location/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ public function loadParentLocationsForDraftContent($contentId);
*/
public function copySubtree($sourceId, $destinationParentId);

public function getSubtreeSize(string $path): int;
/**
* @param int|null $limit
*/
// @phpstan-ignore parameter.notFound
public function getSubtreeSize(string $path /* ?int $limit = null */): int;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you can simply add that parameter to the method as well.

Additionally, you don't need to add extra PHPDoc block if it doesn't provide any extra information.


/**
* Moves location identified by $sourceId into new parent identified by $destinationParentId.
Expand Down
Loading
Loading