Skip to content

Commit a49b6b2

Browse files
author
wslaghekke
committed
Migrate remaining route annotations to attributes, add PasswordAuthenticatedUserInterface to DwhUser
1 parent e306e2f commit a49b6b2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Controller/AbstractDwhApiController.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,11 @@ public function listAction(Request $request, string $type) {
5454
}
5555

5656
/**
57-
* @Route("/{type}/{id}")
58-
*
5957
* @param Request $request
6058
* @param string $type
6159
* @return Response
6260
*/
61+
#[Route("/{type}/{id}")]
6362
public function detailAction(Request $request, string $type) {
6463
$this->checkEntityType($type);
6564

@@ -72,12 +71,11 @@ public function detailAction(Request $request, string $type) {
7271
}
7372

7473
/**
75-
* @Route("", name="recognize_dwh_definition")
76-
*
7774
* @param Request $request
7875
* @param DocumentationService $documentationService
7976
* @return Response
8077
*/
78+
#[Route("", name: "recognize_dwh_definition")]
8179
public function definitionAction(Request $request, DocumentationService $documentationService) {
8280
$documentation = $documentationService->generate($this->entityTypes);
8381

Model/DwhUser.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
namespace Recognize\DwhApplication\Model;
33

44
use Recognize\DwhApplication\Security\Role;
5+
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
56
use Symfony\Component\Security\Core\User\UserInterface;
67

78
/**
89
* Class DwhUser
910
* @package ${NAMESPACE}
1011
* @author Bart Wesselink <b.wesselink@recognize.nl>
1112
*/
12-
class DwhUser implements UserInterface
13+
class DwhUser implements UserInterface, PasswordAuthenticatedUserInterface
1314
{
1415
/** @var string */
1516
private $username;
@@ -26,9 +27,9 @@ public function getRoles(): array
2627
}
2728

2829
/**
29-
* @return string
30+
* @return string|null
3031
*/
31-
public function getPassword()
32+
public function getPassword(): ?string
3233
{
3334
return $this->password;
3435
}

0 commit comments

Comments
 (0)