File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
Validation/Builder/Input/Parser Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change 1414use Ibexa \Rest \Server \Exceptions \ValidationFailedException ;
1515use Ibexa \Rest \Server \Validation \Builder \Input \Parser \BaseInputParserValidatorBuilder ;
1616use Symfony \Component \Validator \Validator \ValidatorInterface ;
17+ use Webmozart \Assert \Assert ;
1718
1819abstract class AbstractDestinationLocationParser extends BaseParser
1920{
@@ -56,8 +57,11 @@ private function getLocationByPath(string $path): Location
5657 private function extractLocationIdFromPath (string $ path ): int
5758 {
5859 $ pathParts = explode ('/ ' , $ path );
60+ $ lastPart = array_pop ($ pathParts );
5961
60- return (int )array_pop ($ pathParts );
62+ Assert::integerish ($ lastPart );
63+
64+ return (int )$ lastPart ;
6165 }
6266
6367 /**
Original file line number Diff line number Diff line change 1212use Symfony \Component \Validator \Constraint ;
1313use Symfony \Component \Validator \Constraints as Assert ;
1414
15- class SwapLocationInputValidatorBuilder extends BaseInputParserValidatorBuilder
15+ final class SwapLocationInputValidatorBuilder extends BaseInputParserValidatorBuilder
1616{
1717 protected function buildConstraint (): Constraint
1818 {
You can’t perform that action at this time.
0 commit comments