diff --git a/code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php b/code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php index 8f56d12fdd..4eea91fbc9 100644 --- a/code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php +++ b/code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php @@ -45,8 +45,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int $user = $this->userService->loadUserByLogin('admin'); $this->permissionResolver->setCurrentUserReference($user); - $parentLocationId = $input->getArgument('parentLocationId'); - $contentId = $input->getArgument('contentId'); + $parentLocationId = (int) $input->getArgument('parentLocationId'); + $contentId = (int) $input->getArgument('contentId'); $locationCreateStruct = $this->locationService->newLocationCreateStruct($parentLocationId); diff --git a/code_samples/api/public_php_api/src/Command/BookmarkCommand.php b/code_samples/api/public_php_api/src/Command/BookmarkCommand.php index cadb24c0a0..8d40d1a100 100644 --- a/code_samples/api/public_php_api/src/Command/BookmarkCommand.php +++ b/code_samples/api/public_php_api/src/Command/BookmarkCommand.php @@ -34,7 +34,7 @@ protected function configure(): void protected function execute(InputInterface $input, OutputInterface $output): int { - $locationId = $input->getArgument('locationId'); + $locationId = (int) $input->getArgument('locationId'); $location = $this->locationService->loadLocation($locationId); $this->bookmarkService->createBookmark($location); diff --git a/code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php b/code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php index 0719390777..ee056f33e4 100644 --- a/code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php +++ b/code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php @@ -40,7 +40,7 @@ private function browseLocation(Location $location, OutputInterface $output, int protected function execute(InputInterface $input, OutputInterface $output): int { - $locationId = $input->getArgument('locationId'); + $locationId = (int) $input->getArgument('locationId'); $location = $this->locationService->loadLocation($locationId); $this->browseLocation($location, $output); diff --git a/code_samples/api/public_php_api/src/Command/CreateContentCommand.php b/code_samples/api/public_php_api/src/Command/CreateContentCommand.php index dd7d8ef686..9cf37efb41 100644 --- a/code_samples/api/public_php_api/src/Command/CreateContentCommand.php +++ b/code_samples/api/public_php_api/src/Command/CreateContentCommand.php @@ -51,7 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $user = $this->userService->loadUserByLogin('admin'); $this->permissionResolver->setCurrentUserReference($user); - $parentLocationId = $input->getArgument('parentLocationId'); + $parentLocationId = (int) $input->getArgument('parentLocationId'); $contentTypeIdentifier = $input->getArgument('contentType'); $name = $input->getArgument('name'); diff --git a/code_samples/api/public_php_api/src/Command/DeleteContentCommand.php b/code_samples/api/public_php_api/src/Command/DeleteContentCommand.php index 21feeb0b63..0d093ec56b 100644 --- a/code_samples/api/public_php_api/src/Command/DeleteContentCommand.php +++ b/code_samples/api/public_php_api/src/Command/DeleteContentCommand.php @@ -38,7 +38,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $user = $this->userService->loadUserByLogin('admin'); $this->permissionResolver->setCurrentUserReference($user); - $locationId = $input->getArgument('locationId'); + $locationId = (int) $input->getArgument('locationId'); $location = $this->locationService->loadLocation($locationId); diff --git a/code_samples/api/public_php_api/src/Command/FindComplexCommand.php b/code_samples/api/public_php_api/src/Command/FindComplexCommand.php index f7810ea3d0..da00ad2413 100644 --- a/code_samples/api/public_php_api/src/Command/FindComplexCommand.php +++ b/code_samples/api/public_php_api/src/Command/FindComplexCommand.php @@ -38,7 +38,7 @@ protected function configure(): void protected function execute(InputInterface $input, OutputInterface $output) { - $locationId = $input->getArgument('locationId'); + $locationId = (int) $input->getArgument('locationId'); $contentTypeIdentifier = $input->getArgument('contentTypeIdentifier'); $text = $input->getArgument('text'); diff --git a/code_samples/api/public_php_api/src/Command/FindInTrashCommand.php b/code_samples/api/public_php_api/src/Command/FindInTrashCommand.php index e619a17376..7da4ec8e60 100644 --- a/code_samples/api/public_php_api/src/Command/FindInTrashCommand.php +++ b/code_samples/api/public_php_api/src/Command/FindInTrashCommand.php @@ -30,7 +30,7 @@ protected function configure(): void protected function execute(InputInterface $input, OutputInterface $output): int { - $contentTypeId = $input->getArgument('contentTypeId'); + $contentTypeId = (int) $input->getArgument('contentTypeId'); $query = new Query(); diff --git a/code_samples/api/public_php_api/src/Command/HideLocationCommand.php b/code_samples/api/public_php_api/src/Command/HideLocationCommand.php index b148f77be0..bbde77ed49 100644 --- a/code_samples/api/public_php_api/src/Command/HideLocationCommand.php +++ b/code_samples/api/public_php_api/src/Command/HideLocationCommand.php @@ -40,7 +40,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $user = $this->userService->loadUserByLogin('admin'); $this->permissionResolver->setCurrentUserReference($user); - $locationId = $input->getArgument('location_id'); + $locationId = (int) $input->getArgument('location_id'); $location = $this->locationService->loadLocation($locationId); diff --git a/code_samples/api/public_php_api/src/Command/MoveContentCommand.php b/code_samples/api/public_php_api/src/Command/MoveContentCommand.php index ceaf3e10a5..fc85c9d551 100644 --- a/code_samples/api/public_php_api/src/Command/MoveContentCommand.php +++ b/code_samples/api/public_php_api/src/Command/MoveContentCommand.php @@ -41,8 +41,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int $user = $this->userService->loadUserByLogin('admin'); $this->permissionResolver->setCurrentUserReference($user); - $locationId = $input->getArgument('locationId'); - $targetLocationId = $input->getArgument('targetLocationId'); + $locationId = (int) $input->getArgument('locationId'); + $targetLocationId = (int) $input->getArgument('targetLocationId'); $sourceLocation = $this->locationService->loadLocation($locationId); $targetLocation = $this->locationService->loadLocation($targetLocationId); diff --git a/code_samples/api/public_php_api/src/Command/ObjectStateCommand.php b/code_samples/api/public_php_api/src/Command/ObjectStateCommand.php index 30740a15b8..2f648bd716 100644 --- a/code_samples/api/public_php_api/src/Command/ObjectStateCommand.php +++ b/code_samples/api/public_php_api/src/Command/ObjectStateCommand.php @@ -73,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } if ($input->getArgument('contentID')) { - $contentId = $input->getArgument('contentID'); + $contentId = (int) $input->getArgument('contentID'); $objectStateToAssign = $objectStateIdentifierList[0]; $contentInfo = $this->contentService->loadContentInfo($contentId); $objectStateGroup = $this->objectStateService->loadObjectStateGroupByIdentifier($objectStateGroupIdentifier); diff --git a/code_samples/api/public_php_api/src/Command/SectionCommand.php b/code_samples/api/public_php_api/src/Command/SectionCommand.php index a90e7049c7..2c3041afc8 100644 --- a/code_samples/api/public_php_api/src/Command/SectionCommand.php +++ b/code_samples/api/public_php_api/src/Command/SectionCommand.php @@ -54,7 +54,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $sectionName = $input->getArgument('sectionName'); $sectionIdentifier = $input->getArgument('sectionIdentifier'); - $contentId = $input->getArgument('contentId'); + $contentId = (int) $input->getArgument('contentId'); $sectionCreateStruct = $this->sectionService->newSectionCreateStruct(); $sectionCreateStruct->name = $sectionName; diff --git a/code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php b/code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php index 1565a1f1fe..595cf00430 100644 --- a/code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php +++ b/code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php @@ -41,8 +41,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int $user = $this->userService->loadUserByLogin('admin'); $this->permissionResolver->setCurrentUserReference($user); - $contentId = $input->getArgument('contentId'); - $locationId = $input->getArgument('locationId'); + $contentId = (int) $input->getArgument('contentId'); + $locationId = (int) $input->getArgument('locationId'); $contentInfo = $this->contentService->loadContentInfo($contentId); diff --git a/code_samples/api/public_php_api/src/Command/TranslateContentCommand.php b/code_samples/api/public_php_api/src/Command/TranslateContentCommand.php index bcc6a328ae..83fbf3883f 100644 --- a/code_samples/api/public_php_api/src/Command/TranslateContentCommand.php +++ b/code_samples/api/public_php_api/src/Command/TranslateContentCommand.php @@ -43,7 +43,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $user = $this->userService->loadUserByLogin('admin'); $this->permissionResolver->setCurrentUserReference($user); - $contentId = $input->getArgument('contentId'); + $contentId = (int) $input->getArgument('contentId'); $language = $input->getArgument('language'); $newName = $input->getArgument('nameInNewLanguage'); $secondaryLanguage = $input->getArgument('secondaryLanguage'); diff --git a/code_samples/api/public_php_api/src/Command/TrashContentCommand.php b/code_samples/api/public_php_api/src/Command/TrashContentCommand.php index 346c228570..f23d8256c2 100644 --- a/code_samples/api/public_php_api/src/Command/TrashContentCommand.php +++ b/code_samples/api/public_php_api/src/Command/TrashContentCommand.php @@ -45,9 +45,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $user = $this->userService->loadUserByLogin('admin'); $this->permissionResolver->setCurrentUserReference($user); - $locationId = $input->getArgument('locationId'); + $locationId = (int) $input->getArgument('locationId'); if ($input->getArgument('newParentId')) { - $newParentId = $input->getArgument('newParentId'); + $newParentId = (int) $input->getArgument('newParentId'); } $location = $this->locationService->loadLocation($locationId); diff --git a/code_samples/api/public_php_api/src/Command/UpdateContentCommand.php b/code_samples/api/public_php_api/src/Command/UpdateContentCommand.php index f654ea3e53..570f525716 100644 --- a/code_samples/api/public_php_api/src/Command/UpdateContentCommand.php +++ b/code_samples/api/public_php_api/src/Command/UpdateContentCommand.php @@ -41,7 +41,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $user = $this->userService->loadUserByLogin('admin'); $this->permissionResolver->setCurrentUserReference($user); - $contentId = $input->getArgument('contentId'); + $contentId = (int) $input->getArgument('contentId'); $newName = $input->getArgument('newName'); $contentInfo = $this->contentService->loadContentInfo($contentId); diff --git a/code_samples/api/public_php_api/src/Command/ViewContentCommand.php b/code_samples/api/public_php_api/src/Command/ViewContentCommand.php index 2a8f69ebb3..e5c22f74fd 100644 --- a/code_samples/api/public_php_api/src/Command/ViewContentCommand.php +++ b/code_samples/api/public_php_api/src/Command/ViewContentCommand.php @@ -37,7 +37,7 @@ protected function configure(): void protected function execute(InputInterface $input, OutputInterface $output): int { - $contentId = $input->getArgument('contentId'); + $contentId = (int) $input->getArgument('contentId'); $content = $this->contentService->loadContent($contentId); $contentType = $this->contentTypeService->loadContentType($content->contentInfo->contentTypeId); diff --git a/code_samples/api/public_php_api/src/Command/WorkflowCommand.php b/code_samples/api/public_php_api/src/Command/WorkflowCommand.php index bbe860c22b..f36d877a77 100644 --- a/code_samples/api/public_php_api/src/Command/WorkflowCommand.php +++ b/code_samples/api/public_php_api/src/Command/WorkflowCommand.php @@ -39,7 +39,7 @@ protected function configure(): void protected function execute(InputInterface $input, OutputInterface $output): int { - $contentId = $input->getArgument('contentId'); + $contentId = (int) $input->getArgument('contentId'); $workflowName = $input->getArgument('workflowName'); $transitionName = $input->getArgument('transitionName');