Skip to content

Commit 18f6e23

Browse files
committed
IBX-8174: Applied review remarks
1 parent 4318968 commit 18f6e23

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"symfony/routing": "^5.3",
4242
"symfony/security-bundle": "^5.3",
4343
"symfony/security-csrf": "^5.3",
44-
"symfony/yaml": "^5.3"
44+
"symfony/yaml": "^5.3",
45+
"webmozart/assert": "^1.11"
4546
},
4647
"require-dev": {
4748
"ibexa/ci-scripts": "^0.2@dev",

src/lib/Server/Input/Parser/RestoreTrashItemInput.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Ibexa\Rest\Server\Exceptions\ValidationFailedException;
1616
use Ibexa\Rest\Server\Validation\Builder\Input\Parser\RestoreTrashItemInputValidatorBuilder;
1717
use Symfony\Component\Validator\Validator\ValidatorInterface;
18+
use Webmozart\Assert\Assert;
1819

1920
final class RestoreTrashItemInput extends BaseParser
2021
{
@@ -59,7 +60,11 @@ private function extractLocationIdFromPath(string $path): int
5960
{
6061
$pathParts = explode('/', $path);
6162

62-
return (int)array_pop($pathParts);
63+
$lastPart = array_pop($pathParts);
64+
65+
Assert::integerish($lastPart);
66+
67+
return (int)$lastPart;
6368
}
6469

6570
/**

0 commit comments

Comments
 (0)