Skip to content

Commit 224171e

Browse files
committed
Add type declarations to class properties
1 parent 58e82f1 commit 224171e

File tree

4 files changed

+6
-24
lines changed

4 files changed

+6
-24
lines changed

src/Action/User/UserCreateAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
final class UserCreateAction
1313
{
14-
private $userCreator;
14+
private object $userCreator;
1515

1616
public function __construct(UserCreator $userCreator)
1717
{

src/Domain/User/Repository/UserCreatorRepository.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55

66
use PDO;
77

8-
/**
9-
* Repository.
10-
*/
118
final class UserCreatorRepository
129
{
1310
private const SQL_INSERT_USER = 'INSERT INTO users SET

src/Domain/User/Service/UserCreator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ final class UserCreator
1313
private const MIN_LENGTH_USERNAME = 2
1414
private const MAX_LENGTH_USERNAME = 16;
1515

16-
/**
17-
* @var UserCreatorRepository
18-
*/
19-
private $repository;
16+
private UserCreatorRepository $repository;
2017

2118
/**
2219
* The constructor.

src/Domain/User/User.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,13 @@
77

88
class User implements JsonSerializable
99
{
10-
/**
11-
* @var int|null
12-
*/
13-
private $id;
10+
private ?int $id;
1411

15-
/**
16-
* @var string
17-
*/
18-
private $username;
12+
private string $username;
1913

20-
/**
21-
* @var string
22-
*/
23-
private $firstName;
14+
private string $firstName;
2415

25-
/**
26-
* @var string
27-
*/
28-
private $lastName;
16+
private string $lastName;
2917

3018
/**
3119
* @param int|null $id

0 commit comments

Comments
 (0)