mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Upgrade project to PHP 8.3, add PHPStan, upgrade almost every dependency (#36)
* start updating to PHP 8.3 * taking off! Co-authored-by: ErickSkrauch <erickskrauch@yandex.ru> Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * dropped this Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * migrate to symfonymailer Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * this is so stupid 😭 Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * ah, free, at last. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * oh, Gabriel. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * now dawns thy reckoning. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * and thy gore shall GLISTEN before the temples of man. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * creature of steel. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * my gratitude upon thee for my freedom. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * but the crimes thy kind has committed against humanity Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * Upgrade PHP-CS-Fixer and do fix the codebase * First review round (maybe I have broken something) * are NOT forgotten. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * Enable parallel PHP-CS-Fixer runner * PHPStan level 1 * PHPStan level 2 * PHPStan level 3 * PHPStan level 4 * PHPStan level 5 * Levels 6 and 7 takes too much effort. Generate a baseline and fix them eventually * Resolve TODO's related to the php-mock * Drastically reduce baseline size with the Rector * More code modernization with help of the Rector * Update GitLab CI --------- Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> Co-authored-by: ErickSkrauch <erickskrauch@yandex.ru>
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
<?php
|
||||
namespace common\helpers;
|
||||
|
||||
use common\components\RabbitMQ\Helper;
|
||||
|
||||
class Amqp extends Helper {
|
||||
|
||||
}
|
||||
@@ -3,71 +3,71 @@ namespace common\helpers;
|
||||
|
||||
final class Error {
|
||||
|
||||
public const USERNAME_REQUIRED = 'error.username_required';
|
||||
public const USERNAME_TOO_SHORT = 'error.username_too_short';
|
||||
public const USERNAME_TOO_LONG = 'error.username_too_long';
|
||||
public const USERNAME_INVALID = 'error.username_invalid';
|
||||
public const USERNAME_NOT_AVAILABLE = 'error.username_not_available';
|
||||
public const string USERNAME_REQUIRED = 'error.username_required';
|
||||
public const string USERNAME_TOO_SHORT = 'error.username_too_short';
|
||||
public const string USERNAME_TOO_LONG = 'error.username_too_long';
|
||||
public const string USERNAME_INVALID = 'error.username_invalid';
|
||||
public const string USERNAME_NOT_AVAILABLE = 'error.username_not_available';
|
||||
|
||||
public const EMAIL_REQUIRED = 'error.email_required';
|
||||
public const EMAIL_TOO_LONG = 'error.email_too_long';
|
||||
public const EMAIL_INVALID = 'error.email_invalid';
|
||||
public const EMAIL_IS_TEMPMAIL = 'error.email_is_tempmail';
|
||||
public const EMAIL_HOST_IS_NOT_ALLOWED = 'error.email_host_is_not_allowed';
|
||||
public const EMAIL_NOT_AVAILABLE = 'error.email_not_available';
|
||||
public const EMAIL_NOT_FOUND = 'error.email_not_found';
|
||||
public const string EMAIL_REQUIRED = 'error.email_required';
|
||||
public const string EMAIL_TOO_LONG = 'error.email_too_long';
|
||||
public const string EMAIL_INVALID = 'error.email_invalid';
|
||||
public const string EMAIL_IS_TEMPMAIL = 'error.email_is_tempmail';
|
||||
public const string EMAIL_HOST_IS_NOT_ALLOWED = 'error.email_host_is_not_allowed';
|
||||
public const string EMAIL_NOT_AVAILABLE = 'error.email_not_available';
|
||||
public const string EMAIL_NOT_FOUND = 'error.email_not_found';
|
||||
|
||||
public const LOGIN_REQUIRED = 'error.login_required';
|
||||
public const LOGIN_NOT_EXIST = 'error.login_not_exist';
|
||||
public const string LOGIN_REQUIRED = 'error.login_required';
|
||||
public const string LOGIN_NOT_EXIST = 'error.login_not_exist';
|
||||
|
||||
public const PASSWORD_REQUIRED = 'error.password_required';
|
||||
public const PASSWORD_INCORRECT = 'error.password_incorrect';
|
||||
public const PASSWORD_TOO_SHORT = 'error.password_too_short';
|
||||
public const string PASSWORD_REQUIRED = 'error.password_required';
|
||||
public const string PASSWORD_INCORRECT = 'error.password_incorrect';
|
||||
public const string PASSWORD_TOO_SHORT = 'error.password_too_short';
|
||||
|
||||
public const KEY_REQUIRED = 'error.key_required';
|
||||
public const KEY_NOT_EXISTS = 'error.key_not_exists';
|
||||
public const KEY_EXPIRE = 'error.key_expire';
|
||||
public const string KEY_REQUIRED = 'error.key_required';
|
||||
public const string KEY_NOT_EXISTS = 'error.key_not_exists';
|
||||
public const string KEY_EXPIRE = 'error.key_expire';
|
||||
|
||||
public const ACCOUNT_BANNED = 'error.account_banned';
|
||||
public const ACCOUNT_NOT_ACTIVATED = 'error.account_not_activated';
|
||||
public const ACCOUNT_ALREADY_ACTIVATED = 'error.account_already_activated';
|
||||
public const ACCOUNT_CANNOT_RESEND_MESSAGE = 'error.account_cannot_resend_message';
|
||||
public const string ACCOUNT_BANNED = 'error.account_banned';
|
||||
public const string ACCOUNT_NOT_ACTIVATED = 'error.account_not_activated';
|
||||
public const string ACCOUNT_ALREADY_ACTIVATED = 'error.account_already_activated';
|
||||
public const string ACCOUNT_CANNOT_RESEND_MESSAGE = 'error.account_cannot_resend_message';
|
||||
|
||||
public const RECENTLY_SENT_MESSAGE = 'error.recently_sent_message';
|
||||
public const string RECENTLY_SENT_MESSAGE = 'error.recently_sent_message';
|
||||
|
||||
public const NEW_PASSWORD_REQUIRED = 'error.newPassword_required';
|
||||
public const NEW_RE_PASSWORD_REQUIRED = 'error.newRePassword_required';
|
||||
public const NEW_RE_PASSWORD_DOES_NOT_MATCH = self::RE_PASSWORD_DOES_NOT_MATCH;
|
||||
public const string NEW_PASSWORD_REQUIRED = 'error.newPassword_required';
|
||||
public const string NEW_RE_PASSWORD_REQUIRED = 'error.newRePassword_required';
|
||||
public const string NEW_RE_PASSWORD_DOES_NOT_MATCH = self::RE_PASSWORD_DOES_NOT_MATCH;
|
||||
|
||||
public const REFRESH_TOKEN_REQUIRED = 'error.refresh_token_required';
|
||||
public const REFRESH_TOKEN_NOT_EXISTS = 'error.refresh_token_not_exist';
|
||||
public const string REFRESH_TOKEN_REQUIRED = 'error.refresh_token_required';
|
||||
public const string REFRESH_TOKEN_NOT_EXISTS = 'error.refresh_token_not_exist';
|
||||
|
||||
public const CAPTCHA_REQUIRED = 'error.captcha_required';
|
||||
public const CAPTCHA_INVALID = 'error.captcha_invalid';
|
||||
public const string CAPTCHA_REQUIRED = 'error.captcha_required';
|
||||
public const string CAPTCHA_INVALID = 'error.captcha_invalid';
|
||||
|
||||
public const RULES_AGREEMENT_REQUIRED = 'error.rulesAgreement_required';
|
||||
public const string RULES_AGREEMENT_REQUIRED = 'error.rulesAgreement_required';
|
||||
|
||||
public const RE_PASSWORD_REQUIRED = 'error.rePassword_required';
|
||||
public const RE_PASSWORD_DOES_NOT_MATCH = 'error.rePassword_does_not_match';
|
||||
public const string RE_PASSWORD_REQUIRED = 'error.rePassword_required';
|
||||
public const string RE_PASSWORD_DOES_NOT_MATCH = 'error.rePassword_does_not_match';
|
||||
|
||||
public const UNSUPPORTED_LANGUAGE = 'error.unsupported_language';
|
||||
public const string UNSUPPORTED_LANGUAGE = 'error.unsupported_language';
|
||||
|
||||
public const SUBJECT_REQUIRED = 'error.subject_required';
|
||||
public const MESSAGE_REQUIRED = 'error.message_required';
|
||||
public const string SUBJECT_REQUIRED = 'error.subject_required';
|
||||
public const string MESSAGE_REQUIRED = 'error.message_required';
|
||||
|
||||
public const TOTP_REQUIRED = 'error.totp_required';
|
||||
public const TOTP_INCORRECT = 'error.totp_incorrect';
|
||||
public const string TOTP_REQUIRED = 'error.totp_required';
|
||||
public const string TOTP_INCORRECT = 'error.totp_incorrect';
|
||||
|
||||
public const OTP_ALREADY_ENABLED = 'error.otp_already_enabled';
|
||||
public const OTP_NOT_ENABLED = 'error.otp_not_enabled';
|
||||
public const string OTP_ALREADY_ENABLED = 'error.otp_already_enabled';
|
||||
public const string OTP_NOT_ENABLED = 'error.otp_not_enabled';
|
||||
|
||||
public const NAME_REQUIRED = 'error.name_required';
|
||||
public const string NAME_REQUIRED = 'error.name_required';
|
||||
|
||||
public const REDIRECT_URI_REQUIRED = 'error.redirectUri_required';
|
||||
public const REDIRECT_URI_INVALID = 'error.redirectUri_invalid';
|
||||
public const string REDIRECT_URI_REQUIRED = 'error.redirectUri_required';
|
||||
public const string REDIRECT_URI_INVALID = 'error.redirectUri_invalid';
|
||||
|
||||
public const WEBSITE_URL_INVALID = 'error.websiteUrl_invalid';
|
||||
public const string WEBSITE_URL_INVALID = 'error.websiteUrl_invalid';
|
||||
|
||||
public const MINECRAFT_SERVER_IP_INVALID = 'error.minecraftServerIp_invalid';
|
||||
public const string MINECRAFT_SERVER_IP_INVALID = 'error.minecraftServerIp_invalid';
|
||||
|
||||
}
|
||||
|
||||
@@ -26,8 +26,9 @@ class StringHelper {
|
||||
|
||||
public static function isUuid(string $uuid): bool {
|
||||
try {
|
||||
Uuid::fromString($uuid);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
/** @throws \InvalidArgumentException */
|
||||
Uuid::fromString($uuid); // @phpstan-ignore staticMethod.resultUnused (we don't care about the result, we need only an exception)
|
||||
} catch (\InvalidArgumentException) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user