Skip to content

Commit

Permalink
deprecation: remove old deprecated routes
Browse files Browse the repository at this point in the history
  • Loading branch information
theus77 committed Dec 21, 2023
1 parent 334573c commit c03a726
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use EMS\CoreBundle\Form\Data\EntityTable;
use EMS\CoreBundle\Form\Form\ActionType;
use EMS\CoreBundle\Form\Form\TableType;
use EMS\CoreBundle\Repository\ContentTypeRepository;
use EMS\CoreBundle\Repository\TemplateRepository;
use EMS\CoreBundle\Service\ActionService;
use Psr\Log\LoggerInterface;
Expand All @@ -32,28 +31,11 @@ public function __construct(
private readonly LoggerInterface $logger,
private readonly ActionService $actionService,
private readonly DataTableFactory $dataTableFactory,
private readonly ContentTypeRepository $contentTypeRepository,
private readonly TemplateRepository $templateRepository,
private readonly string $templateNamespace
) {
}

/** @deprecated */
public function indexAction(string $type): Response
{
\trigger_error('Route template.index is now deprecated, use the route ems_core_action_index', E_USER_DEPRECATED);
$contentTypes = $this->contentTypeRepository->findBy([
'deleted' => false,
'name' => $type,
]);

if (!$contentTypes || 1 != \count($contentTypes)) {
throw new NotFoundHttpException('Content type not found');
}

return $this->redirectToRoute('ems_core_action_index', ['contentType' => $contentTypes[0]->getId()]);
}

public function index(Request $request, ContentType $contentType): Response
{
if ($contentType->getDeleted()) {
Expand Down Expand Up @@ -92,22 +74,6 @@ public function index(Request $request, ContentType $contentType): Response
]);
}

/** @deprecated */
public function addAction(string $type, Request $request): Response
{
\trigger_error('Route template.add is now deprecated, use the route ems_core_action_add', E_USER_DEPRECATED);
$contentTypes = $this->contentTypeRepository->findBy([
'deleted' => false,
'name' => $type,
]);

if (!$contentTypes || 1 != \count($contentTypes)) {
throw new NotFoundHttpException('Content type not found');
}

return $this->add($contentTypes[0], $request);
}

public function add(ContentType $contentType, Request $request): Response
{
$action = new Template();
Expand Down Expand Up @@ -136,14 +102,6 @@ public function add(ContentType $contentType, Request $request): Response
]);
}

/** @deprecated */
public function editAction(Template $id, Request $request, string $_format): Response
{
\trigger_error('Route template.edit is now deprecated, use the route ems_core_action_edit', E_USER_DEPRECATED);

return $this->edit($id, $request, $_format);
}

public function edit(Template $action, Request $request, string $_format): Response
{
$id = $action->getId();
Expand Down
1 change: 0 additions & 1 deletion EMS/core-bundle/src/Resources/config/controllers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
<argument type="service" id="logger" />
<argument type="service" id="ems.service.action" />
<argument type="service" id="emsco.data_table.factory" />
<argument type="service" id="EMS\CoreBundle\Repository\ContentTypeRepository" />
<argument type="service" id="EMS\CoreBundle\Repository\TemplateRepository" />
<argument>%ems_core.template_namespace%</argument>
<call method="setContainer"/>
Expand Down

0 comments on commit c03a726

Please sign in to comment.