Skip to content

Commit 979c7b6

Browse files
authored
[CI] Fixed new phpstan issues (#1708)
1 parent 92dafea commit 979c7b6

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

phpstan-baseline.neon

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,6 @@ parameters:
582582
count: 1
583583
path: src/bundle/Controller/LinkManagerController.php
584584

585-
-
586-
message: '#^Cannot access offset 0 on iterable\<int, Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Relation\>\.$#'
587-
identifier: offsetAccess.nonOffsetAccessible
588-
count: 1
589-
path: src/bundle/Controller/LocationController.php
590-
591585
-
592586
message: '#^Cannot access property \$contentId on Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\|null\.$#'
593587
identifier: property.nonObject
@@ -13152,12 +13146,6 @@ parameters:
1315213146
count: 1
1315313147
path: src/lib/UI/Dataset/VersionsDataset.php
1315413148

13155-
-
13156-
message: '#^Parameter \#2 \$array of function array_map expects array, iterable\<int, Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\VersionInfo\> given\.$#'
13157-
identifier: argument.type
13158-
count: 1
13159-
path: src/lib/UI/Dataset/VersionsDataset.php
13160-
1316113149
-
1316213150
message: '#^Call to an undefined method Ibexa\\Contracts\\Core\\Repository\\PermissionResolver\:\:sudo\(\)\.$#'
1316313151
identifier: method.notFound
@@ -13428,6 +13416,12 @@ parameters:
1342813416
count: 1
1342913417
path: src/lib/UI/Value/ValueFactory.php
1343013418

13419+
-
13420+
message: '#^Strict comparison using \!\=\= between string and null will always evaluate to true\.$#'
13421+
identifier: notIdentical.alwaysTrue
13422+
count: 1
13423+
path: src/lib/UI/Value/ValueFactory.php
13424+
1343113425
-
1343213426
message: '#^Method Ibexa\\AdminUi\\UniversalDiscovery\\ConfigResolver\:\:getConfig\(\) has parameter \$context with no value type specified in iterable type array\.$#'
1343313427
identifier: missingType.iterableValue

src/bundle/Controller/LocationController.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,14 @@ public function copyAction(Request $request): Response
210210
$locationCreateStruct
211211
);
212212

213-
$newLocation = $this->locationService->loadLocation($copiedContent->contentInfo->mainLocationId);
213+
$mainLocationId = $copiedContent->getContentInfo()->getMainLocationId();
214+
if ($mainLocationId === null) {
215+
throw new InvalidArgumentException(
216+
'mainLocationId',
217+
'Copied content does not have a main location'
218+
);
219+
}
220+
$newLocation = $this->locationService->loadLocation($mainLocationId);
214221

215222
$this->notificationHandler->success(
216223
/** @Desc("'%name%' copied to '%location%'") */

src/lib/EventListener/ViewTemplatesListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function setViewTemplates(PreContentViewEvent $event): void
5252
}
5353

5454
/**
55-
* @return string[]
55+
* @return array<class-string, string>
5656
*/
5757
private function getTemplatesMap(): array
5858
{

tests/bundle/DependencyInjection/Configuration/Parser/SubtreeOperationsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class SubtreeOperationsTest extends TestCase
2323
private ContextualizerInterface $contextualizer;
2424

2525
/**
26-
* @return array<string, array{int}>
26+
* @return iterable<string, array{int}>
2727
*/
2828
public function getExpectedCopySubtreeLimit(): iterable
2929
{

0 commit comments

Comments
 (0)