Skip to content

Commit bc66ea9

Browse files
committed
minor #38931 Set constant visibility in tests to private where possible (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- Set constant visibility in tests to private where possible | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A As discussed on Slack, this PR prepares the introduction of a CS fixer rule to enforce explicit visibility declarations for constants. I've checked class constants in test and fixture classes and if I only found usages within the same class, I've declared them `private`. This way, I also found a few constants that weren't used at all anymore, so I've removed those. Commits ------- 43ce6dfe44 Set constant visibility in tests to private where possible.
2 parents 207a76a + e3cd3a8 commit bc66ea9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Tests/Encoder/Argon2iPasswordEncoderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
class Argon2iPasswordEncoderTest extends TestCase
2323
{
24-
const PASSWORD = 'password';
24+
private const PASSWORD = 'password';
2525

2626
protected function setUp(): void
2727
{

Tests/Encoder/BCryptPasswordEncoderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
*/
2222
class BCryptPasswordEncoderTest extends TestCase
2323
{
24-
const PASSWORD = 'password';
25-
const VALID_COST = '04';
24+
private const PASSWORD = 'password';
25+
private const VALID_COST = '04';
2626

2727
public function testCostBelowRange()
2828
{

Tests/Validator/Constraints/UserPasswordValidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
*/
2424
abstract class UserPasswordValidatorTest extends ConstraintValidatorTestCase
2525
{
26-
const PASSWORD = 's3Cr3t';
27-
const SALT = '^S4lt$';
26+
private const PASSWORD = 's3Cr3t';
27+
private const SALT = '^S4lt$';
2828

2929
/**
3030
* @var TokenStorageInterface

0 commit comments

Comments
 (0)