Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-7055: Removed unused method #1011

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading