Skip to content

Commit b5d64ce

Browse files
committed
IBX-8174: Applied review remarks
1 parent 88e29bf commit b5d64ce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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)