From baa79e12e8b2ae10fad3a0e5bf29adfb1c6e6a05 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Wed, 19 Nov 2025 09:57:08 +0100 Subject: [PATCH] apply StyleCI recommendation --- lib/Exception/JsonException.php | 3 ++- lib/Exception/TranslatedException.php | 6 +++--- lib/Json.php | 2 +- lib/Persistence/TrafficLimiter.php | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Exception/JsonException.php b/lib/Exception/JsonException.php index dc844a2d..507e918d 100644 --- a/lib/Exception/JsonException.php +++ b/lib/Exception/JsonException.php @@ -26,7 +26,8 @@ class JsonException extends Exception * @access public * @param int $code */ - public function __construct(int $code) { + public function __construct(int $code) + { $message = 'A JSON error occurred'; if (function_exists('json_last_error_msg')) { $message .= ': ' . json_last_error_msg(); diff --git a/lib/Exception/TranslatedException.php b/lib/Exception/TranslatedException.php index 91ead674..417f5c7a 100644 --- a/lib/Exception/TranslatedException.php +++ b/lib/Exception/TranslatedException.php @@ -27,10 +27,10 @@ class TranslatedException extends Exception * @access public * @param string|array $messageId message ID or array of message ID and parameters * @param int $code - * @param ?Throwable $previous */ - public function __construct(string|array $messageId, int $code = 0, ?Throwable $previous = null) { + public function __construct(string|array $messageId, int $code = 0) + { $message = is_string($messageId) ? I18n::translate($messageId) : forward_static_call_array('PrivateBin\I18n::translate', $messageId); - parent::__construct($message, $code, $previous); + parent::__construct($message, $code); } } \ No newline at end of file diff --git a/lib/Json.php b/lib/Json.php index 6157053c..15453cfa 100644 --- a/lib/Json.php +++ b/lib/Json.php @@ -67,4 +67,4 @@ class Json throw new JsonException($errorCode); } } -} \ No newline at end of file +} diff --git a/lib/Persistence/TrafficLimiter.php b/lib/Persistence/TrafficLimiter.php index 16e76e28..5838a598 100644 --- a/lib/Persistence/TrafficLimiter.php +++ b/lib/Persistence/TrafficLimiter.php @@ -211,7 +211,7 @@ class TrafficLimiter extends AbstractPersistence } throw new TranslatedException(array( 'Please wait %d seconds between each post.', - self::$_limit + self::$_limit, )); } }