Skip to content

Commit

Permalink
IBX-7055: Removed unused method (#1011)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikadamczyk committed Dec 6, 2023
1 parent 7845004 commit 5e56daa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 57 deletions.
31 changes: 3 additions & 28 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,6 @@ parameters:
count: 1
path: src/bundle/Controller/LinkManagerController.php

-
message: "#^Call to method getLocation\\(\\) on an unknown class Ibexa\\\\AdminUi\\\\Form\\\\Data\\\\Location\\\\LocationTrashContainerData\\.$#"
count: 1
path: src/bundle/Controller/LocationController.php

-
message: "#^Cannot access offset 0 on iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\>\\.$#"
count: 1
Expand Down Expand Up @@ -497,7 +492,7 @@ parameters:

-
message: "#^Cannot access property \\$parentLocationId on Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null\\.$#"
count: 2
count: 1
path: src/bundle/Controller/LocationController.php

-
Expand All @@ -507,24 +502,14 @@ parameters:

-
message: "#^Cannot call method getContentInfo\\(\\) on Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null\\.$#"
count: 12
path: src/bundle/Controller/LocationController.php

-
message: "#^Method Ibexa\\\\Bundle\\\\AdminUi\\\\Controller\\\\LocationController\\:\\:handleTrashLocationForm\\(\\) is unused\\.$#"
count: 1
count: 11
path: src/bundle/Controller/LocationController.php

-
message: "#^Parameter \\#1 \\$contentInfo of method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\LocationService\\:\\:createLocation\\(\\) expects Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\ContentInfo, Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\ContentInfo\\|null given\\.$#"
count: 1
path: src/bundle/Controller/LocationController.php

-
message: "#^Parameter \\#1 \\$location of method Ibexa\\\\Contracts\\\\AdminUi\\\\Controller\\\\Controller\\:\\:redirectToLocation\\(\\) expects Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location, Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null given\\.$#"
count: 1
path: src/bundle/Controller/LocationController.php

-
message: "#^Parameter \\#1 \\$location of method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\LocationService\\:\\:getLocationChildCount\\(\\) expects Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location, Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null given\\.$#"
count: 1
Expand All @@ -540,14 +525,9 @@ parameters:
count: 1
path: src/bundle/Controller/LocationController.php

-
message: "#^Parameter \\#1 \\$location of method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\SectionService\\:\\:assignSectionToSubtree\\(\\) expects Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location, Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null given\\.$#"
count: 1
path: src/bundle/Controller/LocationController.php

-
message: "#^Parameter \\#1 \\$location of method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\TrashService\\:\\:trash\\(\\) expects Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location, Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null given\\.$#"
count: 2
count: 1
path: src/bundle/Controller/LocationController.php

-
Expand Down Expand Up @@ -580,11 +560,6 @@ parameters:
count: 1
path: src/bundle/Controller/LocationController.php

-
message: "#^Parameter \\$data of method Ibexa\\\\Bundle\\\\AdminUi\\\\Controller\\\\LocationController\\:\\:handleTrashLocationForm\\(\\) has invalid type Ibexa\\\\AdminUi\\\\Form\\\\Data\\\\Location\\\\LocationTrashContainerData\\.$#"
count: 1
path: src/bundle/Controller/LocationController.php

-
message: "#^Property Ibexa\\\\Bundle\\\\AdminUi\\\\Controller\\\\LocationController\\:\\:\\$contentTypeService is never read, only written\\.$#"
count: 1
Expand Down
30 changes: 1 addition & 29 deletions src/bundle/Controller/LocationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -420,35 +420,6 @@ private function handleTrashLocation(LocationTrashData $data): RedirectResponse
return $this->redirectToLocation($parentLocation);
}

/**
* @param \Ibexa\AdminUi\Form\Data\Location\LocationTrashData|\Ibexa\AdminUi\Form\Data\Location\LocationTrashContainerData $data
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
private function handleTrashLocationForm($data): RedirectResponse
{
$location = $data->getLocation();
$parentLocation = $this->locationService->loadLocation($location->parentLocationId);
$this->trashService->trash($location);

$this->notificationHandler->success(
$this->translator->trans(
/** @Desc("Location '%name%' moved to Trash.") */
'location.trash.success',
['%name%' => $location->getContentInfo()->name],
'ibexa_location'
)
);

return new RedirectResponse($this->generateUrl('ibexa.content.view', [
'contentId' => $parentLocation->contentId,
'locationId' => $parentLocation->id,
]));
}

/**
* Handles removing locations assigned to content item based on submitted form.
*
Expand Down Expand Up @@ -670,6 +641,7 @@ public function assignSectionAction(Request $request): Response
if ($form->isSubmitted()) {
$result = $this->submitHandler->handle($form, function (LocationAssignSubtreeData $data) {
$section = $data->getSection();
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location $location */
$location = $data->getLocation();

$this->sectionService->assignSectionToSubtree($location, $section);
Expand Down

0 comments on commit 5e56daa

Please sign in to comment.