Skip to content

Commit

Permalink
Merge pull request #245 from shochdoerfer/fix/rename_routes
Browse files Browse the repository at this point in the history
Rename route prefix
  • Loading branch information
shochdoerfer authored Jul 7, 2024
2 parents 2ceb6bb + 5d1d8c5 commit 9db15b0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Admin/SecuritytxtAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SecuritytxtAdmin extends Admin
final public const SYSTEM = 'BitExpert';
final public const SECURITY_CONTEXT = 'bitexpert.securitytxt';
final public const SECURITYTXT_LIST_KEY = 'securitytxt';
final public const SECURITYTXT_LIST_VIEW = 'app.securitytxt_list';
final public const SECURITYTXT_LIST_VIEW = 'bitexpert.securitytxt_list';

public function __construct(
private readonly ViewBuilderFactoryInterface $viewBuilderFactory,
Expand Down
1 change: 0 additions & 1 deletion BitExpertSuluSecuritytxtBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace BitExpert\Sulu\SecuritytxtBundle;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class BitExpertSuluSecuritytxtBundle extends Bundle
Expand Down
10 changes: 5 additions & 5 deletions Controller/Admin/SecuritytxtAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(
) {
}

#[Route(path: 'securitytxt/{id}', name: 'app.get_securitytxt', methods: ['GET'])]
#[Route(path: 'securitytxt/{id}', name: 'bitexpert.get_securitytxt', methods: ['GET'])]
public function getAction(int $id): Response
{
$entity = $this->repository->findById($id);
Expand All @@ -51,7 +51,7 @@ public function getAction(int $id): Response
return $this->json($this->getDataForEntity($entity));
}

#[Route(path: 'securitytxt/{id}', name: 'app.put_securitytxt', methods: ['PUT'])]
#[Route(path: 'securitytxt/{id}', name: 'bitexpert.put_securitytxt', methods: ['PUT'])]
public function putAction(int $id, Request $request): Response
{
$entity = $this->repository->findById($id);
Expand All @@ -68,7 +68,7 @@ public function putAction(int $id, Request $request): Response
return $this->json($this->getDataForEntity($entity));
}

#[Route(path: 'securitytxt', name: 'app.post_securitytxt', methods: ['POST'])]
#[Route(path: 'securitytxt', name: 'bitexpert.post_securitytxt', methods: ['POST'])]
public function postAction(Request $request): Response
{
$entity = $this->repository->create();
Expand All @@ -83,15 +83,15 @@ public function postAction(Request $request): Response
return $this->json($this->getDataForEntity($entity), 201);
}

#[Route(path: 'securitytxt/{id}', name: 'app.delete_securitytxt', methods: ['DELETE'])]
#[Route(path: 'securitytxt/{id}', name: 'bitexpert.delete_securitytxt', methods: ['DELETE'])]
public function deleteAction(int $id): Response
{
$this->repository->remove($id);

return $this->json(null, 204);
}

#[Route(path: 'securitytxt', name: 'app.get_securitytxt_list', methods: ['GET'])]
#[Route(path: 'securitytxt', name: 'bitexpert.get_securitytxt_list', methods: ['GET'])]
public function getListAction(): Response
{
$listRepresentation = $this->doctrineListRepresentationFactory->createDoctrineListRepresentation(
Expand Down
4 changes: 2 additions & 2 deletions DependencyInjection/BitExpertSuluSecuritytxtExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public function prepend(ContainerBuilder $container): void
'resources' => [
'securitytxt' => [
'routes' => [
'list' => 'app.get_securitytxt_list',
'detail' => 'app.get_securitytxt',
'list' => 'bitexpert.get_securitytxt_list',
'detail' => 'bitexpert.get_securitytxt',
],
],
],
Expand Down
4 changes: 2 additions & 2 deletions Resources/config/packages/securitytxt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ sulu_admin:
resources:
securitytxt:
routes:
list: app.get_securitytxt_list
detail: app.get_securitytxt
list: bitexpert.get_securitytxt_list
detail: bitexpert.get_securitytxt
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ parameters:
- Repository
ignoreErrors:
- "#Casting to int something that\\'s already int.#"
-
message: "#::getSecurityContexts\\(\\) should return array#"
path: Admin/SecuritytxtAdmin.php

0 comments on commit 9db15b0

Please sign in to comment.