diff --git a/src/core/Fixed/Doctrine.php b/src/core/Fixed/Doctrine.php index cf13b74ef..649d279be 100644 --- a/src/core/Fixed/Doctrine.php +++ b/src/core/Fixed/Doctrine.php @@ -18,6 +18,7 @@ use Doctrine\ORM\QueryBuilder; use LotgdResponse; use Doctrine\ORM\Tools\SchemaTool; +use function class_alias; /** * @method static Expr getExpressionBuilder() diff --git a/src/core/Fixed/EventDispatcher.php b/src/core/Fixed/EventDispatcher.php index daeb77db5..0ac3895b2 100644 --- a/src/core/Fixed/EventDispatcher.php +++ b/src/core/Fixed/EventDispatcher.php @@ -14,6 +14,7 @@ namespace Lotgd\Core\Fixed; use Symfony\Contracts\EventDispatcher\Event; +use function class_alias; /** * @method static Event dispatch($event, string $eventName = null) @@ -23,4 +24,4 @@ class EventDispatcher use StaticTrait; } -\class_alias('Lotgd\Core\Fixed\EventDispatcher', 'LotgdEventDispatcher', false); +class_alias('Lotgd\Core\Fixed\EventDispatcher', 'LotgdEventDispatcher', false); diff --git a/src/core/Fixed/FlashMessages.php b/src/core/Fixed/FlashMessages.php index 015b24ef0..f80e21fc1 100644 --- a/src/core/Fixed/FlashMessages.php +++ b/src/core/Fixed/FlashMessages.php @@ -13,6 +13,8 @@ namespace Lotgd\Core\Fixed; +use function class_alias; + class FlashMessages { use StaticTrait; @@ -23,7 +25,7 @@ class FlashMessages * @param array|string $message * @param string $type */ - public static function addMessage($message, $type = null) + public static function addMessage($message, string $type = null): void { $type = $type ?: 'info'; @@ -37,7 +39,7 @@ public static function addMessage($message, $type = null) * * @return FlashMessages */ - public static function addInfoMessage($message) + public static function addInfoMessage($message): void { self::$instance->add('info', $message); } @@ -49,7 +51,7 @@ public static function addInfoMessage($message) * * @return FlashMessages */ - public static function addSuccessMessage($message) + public static function addSuccessMessage($message): void { self::$instance->add('success', $message); } @@ -61,7 +63,7 @@ public static function addSuccessMessage($message) * * @return FlashMessages */ - public static function addErrorMessage($message) + public static function addErrorMessage($message): void { self::$instance->add('error', $message); } @@ -73,10 +75,10 @@ public static function addErrorMessage($message) * * @return FlashMessages */ - public static function addWarningMessage($message) + public static function addWarningMessage($message): void { self::$instance->add('warning', $message); } } -\class_alias('Lotgd\Core\Fixed\FlashMessages', 'LotgdFlashMessages', false); +class_alias('Lotgd\Core\Fixed\FlashMessages', 'LotgdFlashMessages', false); diff --git a/src/core/Fixed/Format.php b/src/core/Fixed/Format.php index 6b1c260ca..7c8e6a8be 100644 --- a/src/core/Fixed/Format.php +++ b/src/core/Fixed/Format.php @@ -13,6 +13,8 @@ namespace Lotgd\Core\Fixed; +use function class_alias; + /** * This class is for format a string * For example: format a number or a date. @@ -27,4 +29,4 @@ class Format use StaticTrait; } -\class_alias('Lotgd\Core\Fixed\Format', 'LotgdFormat', false); +class_alias('Lotgd\Core\Fixed\Format', 'LotgdFormat', false); diff --git a/src/core/Fixed/Kernel.php b/src/core/Fixed/Kernel.php index 203170c3b..7b1e44b03 100644 --- a/src/core/Fixed/Kernel.php +++ b/src/core/Fixed/Kernel.php @@ -13,6 +13,8 @@ namespace Lotgd\Core\Fixed; +use function class_alias; + class Kernel { use StaticTrait; @@ -42,4 +44,4 @@ public static function getInstance() } } -\class_alias('Lotgd\Core\Fixed\Kernel', 'LotgdKernel', false); +class_alias('Lotgd\Core\Fixed\Kernel', 'LotgdKernel', false); diff --git a/src/core/Fixed/Log.php b/src/core/Fixed/Log.php index 024baab9a..411f266ef 100644 --- a/src/core/Fixed/Log.php +++ b/src/core/Fixed/Log.php @@ -13,6 +13,8 @@ namespace Lotgd\Core\Fixed; +use function class_alias; + /** * @method static void game(string $message, string $category = 'general', bool $filed = false) * @method static void debug(string $message, ?int $target = null, ?int $user = null, ?string $field = null, ?int $value = null, bool $consolidate = true) @@ -22,4 +24,4 @@ class Log use StaticTrait; } -\class_alias('Lotgd\Core\Fixed\Log', 'LotgdLog', false); +class_alias('Lotgd\Core\Fixed\Log', 'LotgdLog', false); diff --git a/src/core/Fixed/Navigation.php b/src/core/Fixed/Navigation.php index 632eef76c..abd9e8698 100644 --- a/src/core/Fixed/Navigation.php +++ b/src/core/Fixed/Navigation.php @@ -13,6 +13,8 @@ namespace Lotgd\Core\Fixed; +use function class_alias; + /** * @method static $this addNav(?string $label, ?string $link = null, array $options = []) * @method static $this addNavNotl(?string $label, ?string $link = null, array $options = []) @@ -32,4 +34,4 @@ class Navigation use StaticTrait; } -\class_alias('Lotgd\Core\Fixed\Navigation', 'LotgdNavigation', false); +class_alias('Lotgd\Core\Fixed\Navigation', 'LotgdNavigation', false); diff --git a/src/core/Fixed/Request.php b/src/core/Fixed/Request.php index 05b043a6c..a06ed8a50 100644 --- a/src/core/Fixed/Request.php +++ b/src/core/Fixed/Request.php @@ -13,6 +13,8 @@ namespace Lotgd\Core\Fixed; +use function class_alias; + /** * @method static mixed getQuery($name, $default = null) * @method static mixed getPost($name, $default = null) @@ -22,4 +24,4 @@ class Request use StaticTrait; } -\class_alias('Lotgd\Core\Fixed\Request', 'LotgdRequest', false); +class_alias('Lotgd\Core\Fixed\Request', 'LotgdRequest', false); diff --git a/src/core/Fixed/Response.php b/src/core/Fixed/Response.php index c3a60f3b7..f23849adb 100644 --- a/src/core/Fixed/Response.php +++ b/src/core/Fixed/Response.php @@ -13,6 +13,8 @@ namespace Lotgd\Core\Fixed; +use function class_alias; + /** * @method static void pageStart($title = null, $parameters = [], $textDomain = null, $locale = null) * @method static void pageTitle($message, $parameters = [], $textDomain = null, $locale = null) @@ -24,4 +26,4 @@ class Response use StaticTrait; } -\class_alias('Lotgd\Core\Fixed\Response', 'LotgdResponse', false); +class_alias('Lotgd\Core\Fixed\Response', 'LotgdResponse', false); diff --git a/src/core/Fixed/Sanitize.php b/src/core/Fixed/Sanitize.php index c6643dae9..f2abcf239 100644 --- a/src/core/Fixed/Sanitize.php +++ b/src/core/Fixed/Sanitize.php @@ -13,6 +13,8 @@ namespace Lotgd\Core\Fixed; +use function class_alias; + /** * This class is for sanitize a string * For example: sanitize a number or a date. @@ -31,4 +33,4 @@ class Sanitize use StaticTrait; } -\class_alias('Lotgd\Core\Fixed\Sanitize', 'LotgdSanitize', false); +class_alias('Lotgd\Core\Fixed\Sanitize', 'LotgdSanitize', false); diff --git a/src/core/Fixed/Session.php b/src/core/Fixed/Session.php index 9772e8309..522cd091b 100644 --- a/src/core/Fixed/Session.php +++ b/src/core/Fixed/Session.php @@ -13,9 +13,11 @@ namespace Lotgd\Core\Fixed; +use function class_alias; + class Session { use StaticTrait; } -\class_alias('Lotgd\Core\Fixed\Session', 'LotgdSession', false); +class_alias('Lotgd\Core\Fixed\Session', 'LotgdSession', false); diff --git a/src/core/Fixed/Setting.php b/src/core/Fixed/Setting.php index 6c8b145a5..6e0a815ca 100644 --- a/src/core/Fixed/Setting.php +++ b/src/core/Fixed/Setting.php @@ -13,6 +13,8 @@ namespace Lotgd\Core\Fixed; +use function class_alias; + /** * @method static mixed getSetting($settingname, $default = null) * @method static bool saveSetting(string $settingname, $value) @@ -22,4 +24,4 @@ class Setting use StaticTrait; } -\class_alias('Lotgd\Core\Fixed\Setting', 'LotgdSetting', false); +class_alias('Lotgd\Core\Fixed\Setting', 'LotgdSetting', false); diff --git a/src/core/Fixed/StaticTrait.php b/src/core/Fixed/StaticTrait.php index 55b1bb2a5..84e43bb6d 100644 --- a/src/core/Fixed/StaticTrait.php +++ b/src/core/Fixed/StaticTrait.php @@ -14,6 +14,10 @@ namespace Lotgd\Core\Fixed; use BadMethodCallException; +use function get_class_methods; +use function implode; +use function method_exists; + trait StaticTrait { /** @@ -38,7 +42,7 @@ public static function __callStatic($method, $arguments) $methods = implode(', ', get_class_methods(self::$instance)); - throw new BadMethodCallException("Undefined method '{$method}'. The method name must be one of '{$methods}'"); + throw new BadMethodCallException("Undefined method '$method'. The method name must be one of '$methods'"); } /** diff --git a/src/core/Fixed/Theme.php b/src/core/Fixed/Theme.php index 8ded6e611..cae3cbe83 100644 --- a/src/core/Fixed/Theme.php +++ b/src/core/Fixed/Theme.php @@ -13,6 +13,8 @@ namespace Lotgd\Core\Fixed; +use function class_alias; + /** * @method static string render($name, array $context = []) * @method static void display($name, array $context = []) @@ -23,4 +25,4 @@ class Theme use StaticTrait; } -\class_alias('Lotgd\Core\Fixed\Theme', 'LotgdTheme', false); +class_alias('Lotgd\Core\Fixed\Theme', 'LotgdTheme', false); diff --git a/src/core/Fixed/Tool.php b/src/core/Fixed/Tool.php index 4b2d34c96..2e33a35ed 100644 --- a/src/core/Fixed/Tool.php +++ b/src/core/Fixed/Tool.php @@ -13,6 +13,8 @@ namespace Lotgd\Core\Fixed; +use function class_alias; + /** * @method static void addNews(string $text, array $params = [], string $textDomain = 'partial_news', bool $hideFromBio = false) * @method static int expForNextLevel(int $curlevel, int $curdk) @@ -35,4 +37,4 @@ class Tool use StaticTrait; } -\class_alias('Lotgd\Core\Fixed\Tool', 'LotgdTool', false); +class_alias('Lotgd\Core\Fixed\Tool', 'LotgdTool', false); diff --git a/src/core/Fixed/Translator.php b/src/core/Fixed/Translator.php index d0acf608b..ade4e7c53 100644 --- a/src/core/Fixed/Translator.php +++ b/src/core/Fixed/Translator.php @@ -14,6 +14,10 @@ namespace Lotgd\Core\Fixed; use BadMethodCallException; +use function class_alias; +use function get_class_methods; +use function implode; +use function method_exists; /** * @method static string t($id, array $parameters = [], $domain = null, $locale = null) @@ -33,7 +37,7 @@ class Translator */ public static function __callStatic($method, $arguments) { - if (\method_exists(self::$instance, $method)) + if (method_exists(self::$instance, $method)) { return self::$instance->{$method}(...$arguments); } @@ -43,10 +47,10 @@ public static function __callStatic($method, $arguments) return self::$instance->trans(...$arguments); } - $methods = \implode(', ', \get_class_methods(self::$instance)); + $methods = implode(', ', get_class_methods(self::$instance)); - throw new BadMethodCallException("Undefined method '{$method}'. The method name must be one of '{$methods}'"); + throw new BadMethodCallException("Undefined method '$method'. The method name must be one of '$methods'"); } } -\class_alias('Lotgd\Core\Fixed\Translator', 'LotgdTranslator', false); +class_alias('Lotgd\Core\Fixed\Translator', 'LotgdTranslator', false);