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

Rename route prefix #245

Merged
merged 3 commits into from
Jul 7, 2024
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
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
Loading