Skip to content

Commit 08ace38

Browse files
committed
[CI] Fixed PHPStan issues
1 parent 024b97d commit 08ace38

File tree

3 files changed

+103
-6
lines changed

3 files changed

+103
-6
lines changed

phpstan-baseline.neon

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8316,6 +8316,12 @@ parameters:
83168316
count: 1
83178317
path: src/contracts/Repository/Values/Content/Location.php
83188318

8319+
-
8320+
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\:\:\$pathString \(string\) on left side of \?\? is not nullable\.$#'
8321+
identifier: nullCoalesce.property
8322+
count: 1
8323+
path: src/contracts/Repository/Values/Content/Location.php
8324+
83198325
-
83208326
message: '#^Class Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\LocationList implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#'
83218327
identifier: missingType.generics
@@ -24414,6 +24420,18 @@ parameters:
2441424420
count: 1
2441524421
path: src/lib/Repository/LocationService.php
2441624422

24423+
-
24424+
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\ContentType\\ContentType\:\:\$defaultSortField \(int\) on left side of \?\? is not nullable\.$#'
24425+
identifier: nullCoalesce.property
24426+
count: 1
24427+
path: src/lib/Repository/LocationService.php
24428+
24429+
-
24430+
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\ContentType\\ContentType\:\:\$defaultSortOrder \(int\) on left side of \?\? is not nullable\.$#'
24431+
identifier: nullCoalesce.property
24432+
count: 1
24433+
path: src/lib/Repository/LocationService.php
24434+
2441724435
-
2441824436
message: '#^Property Ibexa\\Core\\Repository\\LocationService\:\:\$repository \(Ibexa\\Core\\Repository\\Repository\) does not accept Ibexa\\Contracts\\Core\\Repository\\Repository\.$#'
2441924437
identifier: assign.propertyType
@@ -25884,12 +25902,6 @@ parameters:
2588425902
count: 1
2588525903
path: src/lib/Repository/Values/Content/Content.php
2588625904

25887-
-
25888-
message: '#^Cannot access offset mixed on Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Field\.$#'
25889-
identifier: offsetAccess.nonOffsetAccessible
25890-
count: 1
25891-
path: src/lib/Repository/Values/Content/Content.php
25892-
2589325905
-
2589425906
message: '#^Method Ibexa\\Core\\Repository\\Values\\Content\\Content\:\:__construct\(\) has parameter \$data with no value type specified in iterable type array\.$#'
2589525907
identifier: missingType.iterableValue
@@ -74178,12 +74190,24 @@ parameters:
7417874190
count: 1
7417974191
path: tests/lib/Repository/Values/Content/LocationTest.php
7418074192

74193+
-
74194+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
74195+
identifier: staticMethod.alreadyNarrowedType
74196+
count: 1
74197+
path: tests/lib/Repository/Values/Content/LocationTest.php
74198+
7418174199
-
7418274200
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\Content\\LocationTest\:\:assertPropertiesCorrect\(\) has no return type specified\.$#'
7418374201
identifier: missingType.return
7418474202
count: 1
7418574203
path: tests/lib/Repository/Values/Content/LocationTest.php
7418674204

74205+
-
74206+
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\:\:\$id \(int\) in isset\(\) is not nullable\.$#'
74207+
identifier: isset.property
74208+
count: 1
74209+
path: tests/lib/Repository/Values/Content/LocationTest.php
74210+
7418774211
-
7418874212
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\Content\\Query\\Aggregation\\RangeTest\:\:dataProviderForTestToString\(\) return type has no value type specified in iterable type iterable\.$#'
7418974213
identifier: missingType.iterableValue
@@ -74244,6 +74268,12 @@ parameters:
7424474268
count: 1
7424574269
path: tests/lib/Repository/Values/Content/TrashItemTest.php
7424674270

74271+
-
74272+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
74273+
identifier: staticMethod.alreadyNarrowedType
74274+
count: 1
74275+
path: tests/lib/Repository/Values/Content/TrashItemTest.php
74276+
7424774277
-
7424874278
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\Content\\TrashItemTest\:\:assertPropertiesCorrect\(\) has no return type specified\.$#'
7424974279
identifier: missingType.return
@@ -74280,6 +74310,12 @@ parameters:
7428074310
count: 1
7428174311
path: tests/lib/Repository/Values/Content/TrashItemTest.php
7428274312

74313+
-
74314+
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\:\:\$id \(int\) in isset\(\) is not nullable\.$#'
74315+
identifier: isset.property
74316+
count: 1
74317+
path: tests/lib/Repository/Values/Content/TrashItemTest.php
74318+
7428374319
-
7428474320
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\ContentType\\ContentTypeDraftTest\:\:testObjectProperties\(\) has no return type specified\.$#'
7428574321
identifier: missingType.return
@@ -74358,6 +74394,12 @@ parameters:
7435874394
count: 1
7435974395
path: tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.php
7436074396

74397+
-
74398+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
74399+
identifier: staticMethod.alreadyNarrowedType
74400+
count: 1
74401+
path: tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.php
74402+
7436174403
-
7436274404
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\ObjectState\\ObjectStateGroupTest\:\:assertPropertiesCorrect\(\) has no return type specified\.$#'
7436374405
identifier: missingType.return
@@ -74418,6 +74460,12 @@ parameters:
7441874460
count: 1
7441974461
path: tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.php
7442074462

74463+
-
74464+
message: '#^Property Ibexa\\Core\\Repository\\Values\\ObjectState\\ObjectStateGroup\:\:\$defaultLanguageCode \(string\) in isset\(\) is not nullable\.$#'
74465+
identifier: isset.property
74466+
count: 1
74467+
path: tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.php
74468+
7442174469
-
7442274470
message: '#^Access to an undefined property Ibexa\\Core\\Repository\\Values\\ObjectState\\ObjectState\:\:\$notDefined\.$#'
7442374471
identifier: property.notFound
@@ -74532,6 +74580,12 @@ parameters:
7453274580
count: 1
7453374581
path: tests/lib/Repository/Values/User/RoleTest.php
7453474582

74583+
-
74584+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
74585+
identifier: staticMethod.alreadyNarrowedType
74586+
count: 1
74587+
path: tests/lib/Repository/Values/User/RoleTest.php
74588+
7453574589
-
7453674590
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\User\\RoleTest\:\:assertPropertiesCorrect\(\) has no return type specified\.$#'
7453774591
identifier: missingType.return
@@ -74568,6 +74622,12 @@ parameters:
7456874622
count: 1
7456974623
path: tests/lib/Repository/Values/User/RoleTest.php
7457074624

74625+
-
74626+
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\User\\Role\:\:\$id \(int\) in isset\(\) is not nullable\.$#'
74627+
identifier: isset.property
74628+
count: 1
74629+
path: tests/lib/Repository/Values/User/RoleTest.php
74630+
7457174631
-
7457274632
message: '#^Access to an undefined property Ibexa\\Core\\Repository\\Values\\User\\UserGroup\:\:\$notDefined\.$#'
7457374633
identifier: property.notFound
@@ -74628,6 +74688,12 @@ parameters:
7462874688
count: 1
7462974689
path: tests/lib/Repository/Values/User/UserTest.php
7463074690

74691+
-
74692+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
74693+
identifier: staticMethod.alreadyNarrowedType
74694+
count: 1
74695+
path: tests/lib/Repository/Values/User/UserTest.php
74696+
7463174697
-
7463274698
message: '#^Method Ibexa\\Tests\\Core\\Repository\\Values\\User\\UserTest\:\:assertPropertiesCorrect\(\) has no return type specified\.$#'
7463374699
identifier: missingType.return
@@ -74676,6 +74742,12 @@ parameters:
7467674742
count: 1
7467774743
path: tests/lib/Repository/Values/User/UserTest.php
7467874744

74745+
-
74746+
message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\User\\User\:\:\$login \(string\) in isset\(\) is not nullable\.$#'
74747+
identifier: isset.property
74748+
count: 1
74749+
path: tests/lib/Repository/Values/User/UserTest.php
74750+
7467974751
-
7468074752
message: '#^Method Ibexa\\Tests\\Core\\Search\\Common\\FieldValueMapper\\RemoteIdentifierMapperTest\:\:getDataForTestCanMap\(\) return type has no value type specified in iterable type iterable\.$#'
7468174753
identifier: missingType.iterableValue

src/bundle/Core/DependencyInjection/Configuration/ConfigResolver/SiteAccessGroupConfigResolver.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ final public function getParameter(string $paramName, ?string $namespace = null,
5858

5959
protected function resolverHasParameter(SiteAccess $siteAccess, string $paramName, string $namespace): bool
6060
{
61+
if ($this->container === null) {
62+
return false;
63+
}
64+
6165
foreach ($siteAccess->groups as $group) {
6266
$groupScopeParamName = $this->resolveScopeRelativeParamName($paramName, $namespace, $group->getName());
6367
if ($this->container->hasParameter($groupScopeParamName)) {
@@ -70,13 +74,21 @@ protected function resolverHasParameter(SiteAccess $siteAccess, string $paramNam
7074

7175
protected function resolverHasParameterForGroup(SiteAccessGroup $siteAccessGroup, string $paramName, string $namespace): bool
7276
{
77+
if ($this->container === null) {
78+
return false;
79+
}
80+
7381
$groupScopeParamName = $this->resolveScopeRelativeParamName($paramName, $namespace, $siteAccessGroup->getName());
7482

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

7886
protected function getParameterFromResolver(SiteAccess $siteAccess, string $paramName, string $namespace)
7987
{
88+
if ($this->container === null) {
89+
throw new ParameterNotFoundException($paramName, $namespace, []);
90+
}
91+
8092
$triedScopes = [];
8193

8294
foreach ($siteAccess->groups as $group) {
@@ -93,6 +105,10 @@ protected function getParameterFromResolver(SiteAccess $siteAccess, string $para
93105

94106
protected function getParameterFromResolverForGroup(SiteAccessGroup $siteAccessGroup, string $paramName, string $namespace)
95107
{
108+
if ($this->container === null) {
109+
throw new ParameterNotFoundException($paramName, $namespace, [$siteAccessGroup]);
110+
}
111+
96112
$groupScopeParamName = $this->resolveScopeRelativeParamName($paramName, $namespace, $siteAccessGroup->getName());
97113

98114
if (!$this->container->hasParameter($groupScopeParamName)) {

src/bundle/Core/DependencyInjection/Configuration/ConfigResolver/StaticSiteAccessConfigResolver.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class StaticSiteAccessConfigResolver extends SiteAccessConfigResolver
2424

2525
protected function resolverHasParameter(SiteAccess $siteAccess, string $paramName, string $namespace): bool
2626
{
27+
if ($this->container === null) {
28+
return false;
29+
}
30+
2731
return $this->container->hasParameter(
2832
$this->resolveScopeRelativeParamName($paramName, $namespace, $siteAccess->name)
2933
);
@@ -32,6 +36,11 @@ protected function resolverHasParameter(SiteAccess $siteAccess, string $paramNam
3236
protected function getParameterFromResolver(SiteAccess $siteAccess, string $paramName, string $namespace)
3337
{
3438
$scopeRelativeParamName = $this->getScopeRelativeParamName($paramName, $namespace, $siteAccess->name);
39+
40+
if ($this->container === null) {
41+
throw new ParameterNotFoundException($scopeRelativeParamName, $namespace, []);
42+
}
43+
3544
if ($this->container->hasParameter($scopeRelativeParamName)) {
3645
return $this->container->getParameter($scopeRelativeParamName);
3746
}

0 commit comments

Comments
 (0)