Skip to content

Commit c5f52a8

Browse files
authored
IBX-8677: Cast location to integer in copying content action (#178)
1 parent 4a3b399 commit c5f52a8

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,12 +1440,6 @@ parameters:
14401440
count: 1
14411441
path: src/lib/Server/Controller/Content.php
14421442

1443-
-
1444-
message: '#^Parameter \#1 \$parentLocationId of method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:newLocationCreateStruct\(\) expects int, string given\.$#'
1445-
identifier: argument.type
1446-
count: 1
1447-
path: src/lib/Server/Controller/Content.php
1448-
14491443
-
14501444
message: '#^Parameter \#1 \$remoteId of method Ibexa\\Contracts\\Core\\Repository\\ContentService\:\:loadContentInfoByRemoteId\(\) expects string, string\|null given\.$#'
14511445
identifier: argument.type

src/lib/Server/Controller/Content.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public function copyContent($contentId, Request $request)
270270
$parentLocationParts = explode('/', $destination);
271271
$copiedContent = $this->repository->getContentService()->copyContent(
272272
$this->repository->getContentService()->loadContentInfo($contentId),
273-
$this->repository->getLocationService()->newLocationCreateStruct(array_pop($parentLocationParts))
273+
$this->repository->getLocationService()->newLocationCreateStruct((int)array_pop($parentLocationParts))
274274
);
275275

276276
return new Values\ResourceCreated(

0 commit comments

Comments
 (0)