Skip to content
Merged
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
84 changes: 78 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8316,6 +8316,12 @@ parameters:
count: 1
path: src/contracts/Repository/Values/Content/Location.php

-
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\:\:\$pathString \(string\) on left side of \?\? is not nullable\.$#'
identifier: nullCoalesce.property
count: 1
path: src/contracts/Repository/Values/Content/Location.php

-
message: '#^Class Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\LocationList implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#'
identifier: missingType.generics
Expand Down Expand Up @@ -24414,6 +24420,18 @@ parameters:
count: 1
path: src/lib/Repository/LocationService.php

-
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\ContentType\\ContentType\:\:\$defaultSortField \(int\) on left side of \?\? is not nullable\.$#'
identifier: nullCoalesce.property
count: 1
path: src/lib/Repository/LocationService.php

-
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\ContentType\\ContentType\:\:\$defaultSortOrder \(int\) on left side of \?\? is not nullable\.$#'
identifier: nullCoalesce.property
count: 1
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 @@ -25884,12 +25902,6 @@ parameters:
count: 1
path: src/lib/Repository/Values/Content/Content.php

-
message: '#^Cannot access offset mixed on Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Field\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/lib/Repository/Values/Content/Content.php

-
message: '#^Method Ibexa\\Core\\Repository\\Values\\Content\\Content\:\:__construct\(\) has parameter \$data with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down Expand Up @@ -74178,12 +74190,24 @@ parameters:
count: 1
path: tests/lib/Repository/Values/Content/LocationTest.php

-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
identifier: staticMethod.alreadyNarrowedType
count: 1
path: tests/lib/Repository/Values/Content/LocationTest.php

-
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\Content\\LocationTest\:\:assertPropertiesCorrect\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: tests/lib/Repository/Values/Content/LocationTest.php

-
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\:\:\$id \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: tests/lib/Repository/Values/Content/LocationTest.php

-
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\Content\\Query\\Aggregation\\RangeTest\:\:dataProviderForTestToString\(\) return type has no value type specified in iterable type iterable\.$#'
identifier: missingType.iterableValue
Expand Down Expand Up @@ -74244,6 +74268,12 @@ parameters:
count: 1
path: tests/lib/Repository/Values/Content/TrashItemTest.php

-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
identifier: staticMethod.alreadyNarrowedType
count: 1
path: tests/lib/Repository/Values/Content/TrashItemTest.php

-
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\Content\\TrashItemTest\:\:assertPropertiesCorrect\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -74280,6 +74310,12 @@ parameters:
count: 1
path: tests/lib/Repository/Values/Content/TrashItemTest.php

-
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\:\:\$id \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: tests/lib/Repository/Values/Content/TrashItemTest.php

-
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\ContentType\\ContentTypeDraftTest\:\:testObjectProperties\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -74358,6 +74394,12 @@ parameters:
count: 1
path: tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.php

-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
identifier: staticMethod.alreadyNarrowedType
count: 1
path: tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.php

-
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\ObjectState\\ObjectStateGroupTest\:\:assertPropertiesCorrect\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -74418,6 +74460,12 @@ parameters:
count: 1
path: tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.php

-
message: '#^Property Ibexa\\Core\\Repository\\Values\\ObjectState\\ObjectStateGroup\:\:\$defaultLanguageCode \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.php

-
message: '#^Access to an undefined property Ibexa\\Core\\Repository\\Values\\ObjectState\\ObjectState\:\:\$notDefined\.$#'
identifier: property.notFound
Expand Down Expand Up @@ -74532,6 +74580,12 @@ parameters:
count: 1
path: tests/lib/Repository/Values/User/RoleTest.php

-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
identifier: staticMethod.alreadyNarrowedType
count: 1
path: tests/lib/Repository/Values/User/RoleTest.php

-
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\User\\RoleTest\:\:assertPropertiesCorrect\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -74568,6 +74622,12 @@ parameters:
count: 1
path: tests/lib/Repository/Values/User/RoleTest.php

-
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\User\\Role\:\:\$id \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: tests/lib/Repository/Values/User/RoleTest.php

-
message: '#^Access to an undefined property Ibexa\\Core\\Repository\\Values\\User\\UserGroup\:\:\$notDefined\.$#'
identifier: property.notFound
Expand Down Expand Up @@ -74628,6 +74688,12 @@ parameters:
count: 1
path: tests/lib/Repository/Values/User/UserTest.php

-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
identifier: staticMethod.alreadyNarrowedType
count: 1
path: tests/lib/Repository/Values/User/UserTest.php

-
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\User\\UserTest\:\:assertPropertiesCorrect\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -74676,6 +74742,12 @@ parameters:
count: 1
path: tests/lib/Repository/Values/User/UserTest.php

-
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\User\\User\:\:\$login \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: tests/lib/Repository/Values/User/UserTest.php

-
message: '#^Method Ibexa\\Tests\\Core\\Search\\Common\\FieldValueMapper\\RemoteIdentifierMapperTest\:\:getDataForTestCanMap\(\) return type has no value type specified in iterable type iterable\.$#'
identifier: missingType.iterableValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Ibexa\Core\MVC\Exception\ParameterNotFoundException;
use Ibexa\Core\MVC\Symfony\SiteAccess;
use Ibexa\Core\MVC\Symfony\SiteAccessGroup;
use LogicException;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

/**
Expand Down Expand Up @@ -58,6 +59,10 @@ final public function getParameter(string $paramName, ?string $namespace = null,

protected function resolverHasParameter(SiteAccess $siteAccess, string $paramName, string $namespace): bool
{
if ($this->container === null) {
throw new LogicException('Container is not set.');
}

foreach ($siteAccess->groups as $group) {
$groupScopeParamName = $this->resolveScopeRelativeParamName($paramName, $namespace, $group->getName());
if ($this->container->hasParameter($groupScopeParamName)) {
Expand All @@ -70,13 +75,21 @@ protected function resolverHasParameter(SiteAccess $siteAccess, string $paramNam

protected function resolverHasParameterForGroup(SiteAccessGroup $siteAccessGroup, string $paramName, string $namespace): bool
{
if ($this->container === null) {
throw new LogicException('Container is not set.');
}

$groupScopeParamName = $this->resolveScopeRelativeParamName($paramName, $namespace, $siteAccessGroup->getName());

return $this->container->hasParameter($groupScopeParamName);
}

protected function getParameterFromResolver(SiteAccess $siteAccess, string $paramName, string $namespace)
{
if ($this->container === null) {
throw new LogicException('Container is not set.');
}

$triedScopes = [];

foreach ($siteAccess->groups as $group) {
Expand All @@ -93,6 +106,10 @@ protected function getParameterFromResolver(SiteAccess $siteAccess, string $para

protected function getParameterFromResolverForGroup(SiteAccessGroup $siteAccessGroup, string $paramName, string $namespace)
{
if ($this->container === null) {
throw new LogicException('Container is not set.');
}

$groupScopeParamName = $this->resolveScopeRelativeParamName($paramName, $namespace, $siteAccessGroup->getName());

if (!$this->container->hasParameter($groupScopeParamName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Ibexa\Core\MVC\Exception\ParameterNotFoundException;
use Ibexa\Core\MVC\Symfony\SiteAccess;
use Ibexa\Core\MVC\Symfony\SiteAccess\Provider\StaticSiteAccessProvider;
use LogicException;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

/**
Expand All @@ -24,13 +25,21 @@ class StaticSiteAccessConfigResolver extends SiteAccessConfigResolver

protected function resolverHasParameter(SiteAccess $siteAccess, string $paramName, string $namespace): bool
{
if ($this->container === null) {
throw new LogicException('Container is not set.');
}

return $this->container->hasParameter(
$this->resolveScopeRelativeParamName($paramName, $namespace, $siteAccess->name)
);
}

protected function getParameterFromResolver(SiteAccess $siteAccess, string $paramName, string $namespace)
{
if ($this->container === null) {
throw new LogicException('Container is not set.');
}

$scopeRelativeParamName = $this->getScopeRelativeParamName($paramName, $namespace, $siteAccess->name);
if ($this->container->hasParameter($scopeRelativeParamName)) {
return $this->container->getParameter($scopeRelativeParamName);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/FieldType/BinaryBase/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Base value for binary field types.
*
* @property string $path Used for BC with 5.0 (EZP-20948). Equivalent to $id.
* @property-read string $id Unique file ID, set by storage. Read only since 5.3 (EZP-22808).
* @property-read string|null $id Unique file ID, set by storage. Read only since 5.3 (EZP-22808).
*/
abstract class Value extends BaseValue
{
Expand Down
Loading