Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName" />
<exclude-pattern>src/Core/src/App/src/Migration/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ClassConstantTypeHint"/>
</ruleset>
2 changes: 1 addition & 1 deletion src/App/src/InputFilter/Input/EmailInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class EmailInput extends Input
{
public const EMAIL_MAX_LENGTH = 191;
public const int EMAIL_MAX_LENGTH = 191;

public function __construct(?string $name = null, bool $isRequired = true)
{
Expand Down
2 changes: 1 addition & 1 deletion src/App/src/InputFilter/Input/FirstNameInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class FirstNameInput extends Input
{
public const FIRSTNAME_MAX_LENGTH = 191;
public const int FIRSTNAME_MAX_LENGTH = 191;

public function __construct(?string $name = null, bool $isRequired = true)
{
Expand Down
4 changes: 2 additions & 2 deletions src/App/src/InputFilter/Input/IdentityInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

class IdentityInput extends Input
{
public const IDENTITY_MIN_LENGTH = 3;
public const IDENTITY_MAX_LENGTH = 100;
public const int IDENTITY_MIN_LENGTH = 3;
public const int IDENTITY_MAX_LENGTH = 100;

public function __construct(?string $name = null, bool $isRequired = true)
{
Expand Down
2 changes: 1 addition & 1 deletion src/App/src/InputFilter/Input/LastNameInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class LastNameInput extends Input
{
public const LASTNAME_MAX_LENGTH = 191;
public const int LASTNAME_MAX_LENGTH = 191;

public function __construct(?string $name = null, bool $isRequired = true)
{
Expand Down
4 changes: 2 additions & 2 deletions src/App/src/InputFilter/Input/PasswordInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

class PasswordInput extends Input
{
public const PASSWORD_MIN_LENGTH = 8;
public const PASSWORD_MAX_LENGTH = 150;
public const int PASSWORD_MIN_LENGTH = 8;
public const int PASSWORD_MAX_LENGTH = 150;

public function __construct(?string $name = null, bool $isRequired = true)
{
Expand Down
2 changes: 1 addition & 1 deletion src/App/src/Middleware/ContentNegotiationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

class ContentNegotiationMiddleware implements MiddlewareInterface
{
public const DEFAULT_HEADERS = 'default';
public const string DEFAULT_HEADERS = 'default';

/**
* @param array<non-empty-string, mixed> $config
Expand Down
2 changes: 1 addition & 1 deletion src/App/src/Middleware/DeprecationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

class DeprecationMiddleware implements MiddlewareInterface
{
public const RESOURCE_DEPRECATION_ATTRIBUTE = ResourceDeprecation::class;
public const string RESOURCE_DEPRECATION_ATTRIBUTE = ResourceDeprecation::class;

/**
* @param array<non-empty-string, mixed> $config
Expand Down
2 changes: 1 addition & 1 deletion src/App/src/Service/ErrorReportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

class ErrorReportService implements ErrorReportServiceInterface
{
private const HEADER_NAME = 'Error-Reporting-Token';
private const string HEADER_NAME = 'Error-Reporting-Token';

private Filesystem $fileSystem;
private ?string $token = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Admin/src/DBAL/Types/AdminRoleEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class AdminRoleEnumType extends AbstractEnumType
{
public const NAME = 'admin_role_enum';
public const string NAME = 'admin_role_enum';

public function getEnumClass(): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Admin/src/DBAL/Types/AdminStatusEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class AdminStatusEnumType extends AbstractEnumType
{
public const NAME = 'admin_status_enum';
public const string NAME = 'admin_status_enum';

public function getEnumClass(): string
{
Expand Down
3 changes: 2 additions & 1 deletion src/Core/src/App/src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
*/
class ConfigProvider
{
public const REGEXP_UUID = '{id:[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}}';
public const string REGEXP_UUID =
'{id:[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}}';

/**
* @return ConfigType
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/App/src/DBAL/Types/SuccessFailureEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class SuccessFailureEnumType extends AbstractEnumType
{
public const NAME = 'success_failure_enum';
public const string NAME = 'success_failure_enum';

public function getEnumClass(): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/App/src/DBAL/Types/UuidType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class UuidType extends \Ramsey\Uuid\Doctrine\UuidType
{
public const NAME = 'uuid';
public const string NAME = 'uuid';

public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/App/src/DBAL/Types/YesNoEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class YesNoEnumType extends AbstractEnumType
{
public const NAME = 'yes_no_enum';
public const string NAME = 'yes_no_enum';

public function getEnumClass(): string
{
Expand Down
120 changes: 60 additions & 60 deletions src/Core/src/App/src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,68 +10,68 @@

class Message
{
public const ACCOUNT_UPDATED = 'Your account was updated successfully.';
public const ADMIN_CONFIRM_DELETION = 'Please confirm the admin deletion.';
public const ADMIN_CREATED = 'Admin created successfully.';
public const ADMIN_DELETED = 'Admin deleted successfully';
public const ADMIN_INACTIVE = 'Admin account is inactive.';
public const ADMIN_NOT_FOUND = 'Admin not found.';
public const ADMIN_UPDATED = 'Admin updated successfully.';
public const AN_ERROR_OCCURRED = 'An error occurred, please try again later.';
public const DUPLICATE_EMAIL = 'An account with this email address already exists.';
public const DUPLICATE_IDENTITY = 'An account with this identity already exists.';
public const ERROR_REPORT_OK = 'Error report successfully saved.';
public const ERROR_REPORT_NOT_ALLOWED = 'You are not allowed to report errors.';
public const ERROR_REPORT_NOT_ENABLED = 'Remote error reporting is not enabled.';
public const INVALID_CLIENT_ID = 'Invalid client_id.';
public const INVALID_CONFIG = 'Invalid configuration value: "%s"';
public const INVALID_CSRF = 'Invalid CSRF.';
public const INVALID_CURRENT_PASSWORD = 'Current password is incorrect.';
public const INVALID_VALUE = 'The value specified for "%s" is invalid.';
public const MAIL_NOT_SENT_TO = 'Could not send mail to "%s".';
public const MAIL_SENT_RECOVER_IDENTITY = 'If the provided email identifies an account in our system, '
public const string ACCOUNT_UPDATED = 'Your account was updated successfully.';
public const string ADMIN_CONFIRM_DELETION = 'Please confirm the admin deletion.';
public const string ADMIN_CREATED = 'Admin created successfully.';
public const string ADMIN_DELETED = 'Admin deleted successfully';
public const string ADMIN_INACTIVE = 'Admin account is inactive.';
public const string ADMIN_NOT_FOUND = 'Admin not found.';
public const string ADMIN_UPDATED = 'Admin updated successfully.';
public const string AN_ERROR_OCCURRED = 'An error occurred, please try again later.';
public const string DUPLICATE_EMAIL = 'An account with this email address already exists.';
public const string DUPLICATE_IDENTITY = 'An account with this identity already exists.';
public const string ERROR_REPORT_OK = 'Error report successfully saved.';
public const string ERROR_REPORT_NOT_ALLOWED = 'You are not allowed to report errors.';
public const string ERROR_REPORT_NOT_ENABLED = 'Remote error reporting is not enabled.';
public const string INVALID_CLIENT_ID = 'Invalid client_id.';
public const string INVALID_CONFIG = 'Invalid configuration value: "%s"';
public const string INVALID_CSRF = 'Invalid CSRF.';
public const string INVALID_CURRENT_PASSWORD = 'Current password is incorrect.';
public const string INVALID_VALUE = 'The value specified for "%s" is invalid.';
public const string MAIL_NOT_SENT_TO = 'Could not send mail to "%s".';
public const string MAIL_SENT_RECOVER_IDENTITY = 'If the provided email identifies an account in our system, '
. 'you will receive an email with your account\'s identity.';
public const MAIL_SENT_RESET_PASSWORD = 'If the provided email identifies an account in our system, '
public const string MAIL_SENT_RESET_PASSWORD = 'If the provided email identifies an account in our system, '
. 'you will receive an email with further instructions on resetting your account\'s password.';
public const MAIL_SENT_USER_ACTIVATION = 'User activation mail has been successfully sent to "%s"';
public const MISSING_CONFIG = 'Missing configuration value: "%s".';
public const NOT_ACCEPTABLE = 'Not acceptable.';
public const RESET_PASSWORD_EXPIRED = 'Reset password hash is invalid (expired).';
public const RESET_PASSWORD_NOT_FOUND = 'Reset password request not found.';
public const RESET_PASSWORD_OK = 'Password successfully modified.';
public const RESET_PASSWORD_USED = 'Reset password hash is invalid (used).';
public const RESET_PASSWORD_VALID = 'Reset password hash is valid.';
public const RESOURCE_ALREADY_REGISTERED = 'Resource "%s" is already registered.';
public const RESOURCE_NOT_ALLOWED = 'You are not allowed to access this resource.';
public const RESOURCE_NOT_FOUND = '%s not found.';
public const RESTRICTION_IMAGE = 'File must be an image> Accepted mim type(s): %s';
public const RESTRICTION_ROLES = 'At least one role is required.';
public const ROLE_NOT_FOUND = 'Role not found.';
public const SERVICE_NOT_FOUND = 'Service %s not found in the container.';
public const SETTING_NOT_FOUND = 'Setting "%s" not found.';
public const TEMPLATE_NOT_FOUND = 'Template "%s" not found.';
public const UNSUPPORTED_MEDIA_TYPE = 'Unsupported Media Type.';
public const USER_ACTIVATED = 'User account has been activated.';
public const USER_ALREADY_ACTIVATED = 'User account is already active.';
public const USER_ALREADY_DEACTIVATED = 'User account is already inactive.';
public const USER_AVATAR_MISSING = 'User avatar not found.';
public const USER_AVATAR_UPDATED = 'User avatar updated successfully.';
public const USER_CONFIRM_DELETION = 'Please confirm the user deletion.';
public const USER_CREATED = 'User created successfully.';
public const USER_DEACTIVATED = 'User account has been deactivated.';
public const USER_DELETED = 'User account deleted successfully.';
public const USER_NOT_ACTIVATED = 'User account must be activated first.';
public const USER_NOT_FOUND = 'User not found.';
public const USER_UPDATED = 'User updated successfully.';
public const VALIDATOR_INVALID_CHARACTERS = 'The value specified contains invalid characters.';
public const VALIDATOR_INVALID_DATA = 'The submitted request contains invalid data.';
public const VALIDATOR_INVALID_EMAIL = 'The value specified must be a valid email address.';
public const VALIDATOR_LENGTH_MAX = 'The value specified must have at most %d characters.';
public const VALIDATOR_LENGTH_MIN = 'The value specified must have at least %d characters.';
public const VALIDATOR_LENGTH_MIN_MAX = 'The value specified must have between %d and %d characters.';
public const VALIDATOR_MISMATCH = '"%s" and "%s" do not match.';
public const VALIDATOR_REQUIRED_FIELD = 'This field is required and cannot be empty.';
public const VALIDATOR_REQUIRED_UPLOAD = 'A file must be uploaded first.';
public const string MAIL_SENT_USER_ACTIVATION = 'User activation mail has been successfully sent to "%s"';
public const string MISSING_CONFIG = 'Missing configuration value: "%s".';
public const string NOT_ACCEPTABLE = 'Not acceptable.';
public const string RESET_PASSWORD_EXPIRED = 'Reset password hash is invalid (expired).';
public const string RESET_PASSWORD_NOT_FOUND = 'Reset password request not found.';
public const string RESET_PASSWORD_OK = 'Password successfully modified.';
public const string RESET_PASSWORD_USED = 'Reset password hash is invalid (used).';
public const string RESET_PASSWORD_VALID = 'Reset password hash is valid.';
public const string RESOURCE_ALREADY_REGISTERED = 'Resource "%s" is already registered.';
public const string RESOURCE_NOT_ALLOWED = 'You are not allowed to access this resource.';
public const string RESOURCE_NOT_FOUND = '%s not found.';
public const string RESTRICTION_IMAGE = 'File must be an image> Accepted mim type(s): %s';
public const string RESTRICTION_ROLES = 'At least one role is required.';
public const string ROLE_NOT_FOUND = 'Role not found.';
public const string SERVICE_NOT_FOUND = 'Service %s not found in the container.';
public const string SETTING_NOT_FOUND = 'Setting "%s" not found.';
public const string TEMPLATE_NOT_FOUND = 'Template "%s" not found.';
public const string UNSUPPORTED_MEDIA_TYPE = 'Unsupported Media Type.';
public const string USER_ACTIVATED = 'User account has been activated.';
public const string USER_ALREADY_ACTIVATED = 'User account is already active.';
public const string USER_ALREADY_DEACTIVATED = 'User account is already inactive.';
public const string USER_AVATAR_MISSING = 'User avatar not found.';
public const string USER_AVATAR_UPDATED = 'User avatar updated successfully.';
public const string USER_CONFIRM_DELETION = 'Please confirm the user deletion.';
public const string USER_CREATED = 'User created successfully.';
public const string USER_DEACTIVATED = 'User account has been deactivated.';
public const string USER_DELETED = 'User account deleted successfully.';
public const string USER_NOT_ACTIVATED = 'User account must be activated first.';
public const string USER_NOT_FOUND = 'User not found.';
public const string USER_UPDATED = 'User updated successfully.';
public const string VALIDATOR_INVALID_CHARACTERS = 'The value specified contains invalid characters.';
public const string VALIDATOR_INVALID_DATA = 'The submitted request contains invalid data.';
public const string VALIDATOR_INVALID_EMAIL = 'The value specified must be a valid email address.';
public const string VALIDATOR_LENGTH_MAX = 'The value specified must have at most %d characters.';
public const string VALIDATOR_LENGTH_MIN = 'The value specified must have at least %d characters.';
public const string VALIDATOR_LENGTH_MIN_MAX = 'The value specified must have between %d and %d characters.';
public const string VALIDATOR_MISMATCH = '"%s" and "%s" do not match.';
public const string VALIDATOR_REQUIRED_FIELD = 'This field is required and cannot be empty.';
public const string VALIDATOR_REQUIRED_UPLOAD = 'A file must be uploaded first.';

/**
* @return non-empty-string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class SettingIdentifierEnumType extends AbstractEnumType
{
public const NAME = 'setting_enum';
public const string NAME = 'setting_enum';

public function getEnumClass(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class UserResetPasswordStatusEnumType extends AbstractEnumType
{
public const NAME = 'user_reset_password_status_enum';
public const string NAME = 'user_reset_password_status_enum';

public function getEnumClass(): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/User/src/DBAL/Types/UserRoleEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class UserRoleEnumType extends AbstractEnumType
{
public const NAME = 'user_role_enum';
public const string NAME = 'user_role_enum';

public function getEnumClass(): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/User/src/DBAL/Types/UserStatusEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class UserStatusEnumType extends AbstractEnumType
{
public const NAME = 'user_status_enum';
public const string NAME = 'user_status_enum';

public function getEnumClass(): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/User/src/Service/UserAvatarService.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

class UserAvatarService implements UserAvatarServiceInterface
{
public const EXTENSIONS = [
public const array EXTENSIONS = [
'image/jpg' => 'jpg',
'image/jpeg' => 'jpg',
'image/png' => 'png',
Expand Down
2 changes: 1 addition & 1 deletion test/Functional/AbstractFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AbstractFunctionalTest extends TestCase

protected Application $app;
protected ContainerInterface $container;
protected const DEFAULT_PASSWORD = 'dotkernel';
protected const string DEFAULT_PASSWORD = 'dotkernel';

/**
* @throws NotFoundExceptionInterface
Expand Down