mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 17:23:12 +08:00
Updated to coding-standard library v1.2.2
This commit is contained in:
@@ -12,7 +12,7 @@ class DeleteShortUrlException extends RuntimeException
|
||||
/** @var int */
|
||||
private $visitsThreshold;
|
||||
|
||||
public function __construct(int $visitsThreshold, string $message = '', int $code = 0, Throwable $previous = null)
|
||||
public function __construct(int $visitsThreshold, string $message = '', int $code = 0, ?Throwable $previous = null)
|
||||
{
|
||||
$this->visitsThreshold = $visitsThreshold;
|
||||
parent::__construct($message, $code, $previous);
|
||||
|
||||
@@ -9,7 +9,7 @@ use function sprintf;
|
||||
|
||||
class InvalidUrlException extends RuntimeException
|
||||
{
|
||||
public static function fromUrl(string $url, Throwable $previous = null): self
|
||||
public static function fromUrl(string $url, ?Throwable $previous = null): self
|
||||
{
|
||||
$code = $previous !== null ? $previous->getCode() : -1;
|
||||
return new static(sprintf('Provided URL "%s" is not an existing and valid URL', $url), $code, $previous);
|
||||
|
||||
@@ -6,12 +6,12 @@ namespace Shlinkio\Shlink\Core\Exception;
|
||||
use Throwable;
|
||||
use Zend\InputFilter\InputFilterInterface;
|
||||
|
||||
use const PHP_EOL;
|
||||
|
||||
use function is_array;
|
||||
use function print_r;
|
||||
use function sprintf;
|
||||
|
||||
use const PHP_EOL;
|
||||
|
||||
class ValidationException extends RuntimeException
|
||||
{
|
||||
/** @var array */
|
||||
@@ -21,7 +21,7 @@ class ValidationException extends RuntimeException
|
||||
string $message = '',
|
||||
array $invalidElements = [],
|
||||
int $code = 0,
|
||||
Throwable $previous = null
|
||||
?Throwable $previous = null
|
||||
) {
|
||||
$this->invalidElements = $invalidElements;
|
||||
parent::__construct($message, $code, $previous);
|
||||
@@ -32,7 +32,7 @@ class ValidationException extends RuntimeException
|
||||
* @param \Throwable|null $prev
|
||||
* @return ValidationException
|
||||
*/
|
||||
public static function fromInputFilter(InputFilterInterface $inputFilter, Throwable $prev = null): self
|
||||
public static function fromInputFilter(InputFilterInterface $inputFilter, ?Throwable $prev = null): self
|
||||
{
|
||||
return static::fromArray($inputFilter->getMessages(), $prev);
|
||||
}
|
||||
@@ -42,7 +42,7 @@ class ValidationException extends RuntimeException
|
||||
* @param \Throwable|null $prev
|
||||
* @return ValidationException
|
||||
*/
|
||||
private static function fromArray(array $invalidData, Throwable $prev = null): self
|
||||
private static function fromArray(array $invalidData, ?Throwable $prev = null): self
|
||||
{
|
||||
return new self(
|
||||
sprintf(
|
||||
|
||||
Reference in New Issue
Block a user