Skip to content

Commit deaf214

Browse files
Use typed properties in tests as much as possible
1 parent 8e39d16 commit deaf214

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

Tests/Command/UserPasswordHashCommandTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424

2525
class UserPasswordHashCommandTest extends TestCase
2626
{
27-
/** @var CommandTester */
28-
private $passwordHasherCommandTester;
29-
private $colSize;
27+
private ?CommandTester $passwordHasherCommandTester = null;
28+
private string|false $colSize;
3029

3130
public function testEncodePasswordEmptySalt()
3231
{

Tests/Fixtures/TestLegacyPasswordAuthenticatedUser.php

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

88
final class TestLegacyPasswordAuthenticatedUser implements LegacyPasswordAuthenticatedUserInterface, UserInterface
99
{
10-
private $username;
11-
private $password;
12-
private $salt;
13-
private $roles;
10+
private string $username;
11+
private ?string $password;
12+
private ?string $salt;
13+
private array $roles;
1414

1515
public function __construct(string $username, ?string $password = null, ?string $salt = null, array $roles = [])
1616
{

Tests/Fixtures/TestPasswordAuthenticatedUser.php

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

77
final class TestPasswordAuthenticatedUser implements PasswordAuthenticatedUserInterface
88
{
9-
private $password;
9+
private ?string $password;
1010

1111
public function __construct(?string $password = null)
1212
{

Tests/Hasher/PasswordHasherFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class SomeChildUser extends SomeUser
218218

219219
class HasherAwareUser extends SomeUser implements PasswordHasherAwareInterface
220220
{
221-
public $hasherName = 'hasher_name';
221+
public ?string $hasherName = 'hasher_name';
222222

223223
public function getPasswordHasherName(): ?string
224224
{

0 commit comments

Comments
 (0)