Skip to content

Commit ebaa1af

Browse files
authored
Merge pull request #537 from dotkernel/issue-535
Issue #535: Added class constant type declarations
2 parents 1c79250 + 8fe536f commit ebaa1af

22 files changed

Lines changed: 84 additions & 82 deletions

‎phpcs.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@
2424
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName" />
2525
<exclude-pattern>src/Core/src/App/src/Migration/*</exclude-pattern>
2626
</rule>
27+
<rule ref="SlevomatCodingStandard.TypeHints.ClassConstantTypeHint"/>
2728
</ruleset>

‎src/App/src/InputFilter/Input/EmailInput.php‎

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

1515
class EmailInput extends Input
1616
{
17-
public const EMAIL_MAX_LENGTH = 191;
17+
public const int EMAIL_MAX_LENGTH = 191;
1818

1919
public function __construct(?string $name = null, bool $isRequired = true)
2020
{

‎src/App/src/InputFilter/Input/FirstNameInput.php‎

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

1414
class FirstNameInput extends Input
1515
{
16-
public const FIRSTNAME_MAX_LENGTH = 191;
16+
public const int FIRSTNAME_MAX_LENGTH = 191;
1717

1818
public function __construct(?string $name = null, bool $isRequired = true)
1919
{

‎src/App/src/InputFilter/Input/IdentityInput.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
class IdentityInput extends Input
1515
{
16-
public const IDENTITY_MIN_LENGTH = 3;
17-
public const IDENTITY_MAX_LENGTH = 100;
16+
public const int IDENTITY_MIN_LENGTH = 3;
17+
public const int IDENTITY_MAX_LENGTH = 100;
1818

1919
public function __construct(?string $name = null, bool $isRequired = true)
2020
{

‎src/App/src/InputFilter/Input/LastNameInput.php‎

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

1414
class LastNameInput extends Input
1515
{
16-
public const LASTNAME_MAX_LENGTH = 191;
16+
public const int LASTNAME_MAX_LENGTH = 191;
1717

1818
public function __construct(?string $name = null, bool $isRequired = true)
1919
{

‎src/App/src/InputFilter/Input/PasswordInput.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
class PasswordInput extends Input
1515
{
16-
public const PASSWORD_MIN_LENGTH = 8;
17-
public const PASSWORD_MAX_LENGTH = 150;
16+
public const int PASSWORD_MIN_LENGTH = 8;
17+
public const int PASSWORD_MAX_LENGTH = 150;
1818

1919
public function __construct(?string $name = null, bool $isRequired = true)
2020
{

‎src/App/src/Middleware/ContentNegotiationMiddleware.php‎

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

3232
class ContentNegotiationMiddleware implements MiddlewareInterface
3333
{
34-
public const DEFAULT_HEADERS = 'default';
34+
public const string DEFAULT_HEADERS = 'default';
3535

3636
/**
3737
* @param array<non-empty-string, mixed> $config

‎src/App/src/Middleware/DeprecationMiddleware.php‎

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

2626
class DeprecationMiddleware implements MiddlewareInterface
2727
{
28-
public const RESOURCE_DEPRECATION_ATTRIBUTE = ResourceDeprecation::class;
28+
public const string RESOURCE_DEPRECATION_ATTRIBUTE = ResourceDeprecation::class;
2929

3030
/**
3131
* @param array<non-empty-string, mixed> $config

‎src/App/src/Service/ErrorReportService.php‎

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

2828
class ErrorReportService implements ErrorReportServiceInterface
2929
{
30-
private const HEADER_NAME = 'Error-Reporting-Token';
30+
private const string HEADER_NAME = 'Error-Reporting-Token';
3131

3232
private Filesystem $fileSystem;
3333
private ?string $token = null;

‎src/Core/src/Admin/src/DBAL/Types/AdminRoleEnumType.php‎

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

1010
class AdminRoleEnumType extends AbstractEnumType
1111
{
12-
public const NAME = 'admin_role_enum';
12+
public const string NAME = 'admin_role_enum';
1313

1414
public function getEnumClass(): string
1515
{

0 commit comments

Comments
 (0)