mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-03-05 13:30:32 -05:00
apply StyleCI recommendation
This commit is contained in:
@@ -26,7 +26,8 @@ class JsonException extends Exception
|
|||||||
* @access public
|
* @access public
|
||||||
* @param int $code
|
* @param int $code
|
||||||
*/
|
*/
|
||||||
public function __construct(int $code) {
|
public function __construct(int $code)
|
||||||
|
{
|
||||||
$message = 'A JSON error occurred';
|
$message = 'A JSON error occurred';
|
||||||
if (function_exists('json_last_error_msg')) {
|
if (function_exists('json_last_error_msg')) {
|
||||||
$message .= ': ' . json_last_error_msg();
|
$message .= ': ' . json_last_error_msg();
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ class TranslatedException extends Exception
|
|||||||
* @access public
|
* @access public
|
||||||
* @param string|array $messageId message ID or array of message ID and parameters
|
* @param string|array $messageId message ID or array of message ID and parameters
|
||||||
* @param int $code
|
* @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);
|
$message = is_string($messageId) ? I18n::translate($messageId) : forward_static_call_array('PrivateBin\I18n::translate', $messageId);
|
||||||
parent::__construct($message, $code, $previous);
|
parent::__construct($message, $code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,4 +67,4 @@ class Json
|
|||||||
throw new JsonException($errorCode);
|
throw new JsonException($errorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ class TrafficLimiter extends AbstractPersistence
|
|||||||
}
|
}
|
||||||
throw new TranslatedException(array(
|
throw new TranslatedException(array(
|
||||||
'Please wait %d seconds between each post.',
|
'Please wait %d seconds between each post.',
|
||||||
self::$_limit
|
self::$_limit,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user