Release 2.20.0 (#4987)
This commit is contained in:
@@ -96,7 +96,7 @@ final class Color
|
||||
|
||||
public function getRandomColor(): string
|
||||
{
|
||||
return sprintf('#%06x', rand(0, 16777215));
|
||||
return \sprintf('#%06x', rand(0, 16777215));
|
||||
}
|
||||
|
||||
public function getRandomFromPalette(string $input): string
|
||||
|
||||
@@ -85,7 +85,7 @@ final class Duration
|
||||
self::FORMAT_COLON => $this->parseColonFormat($duration),
|
||||
self::FORMAT_NATURAL => $this->parseNaturalFormat($duration),
|
||||
self::FORMAT_DECIMAL => $this->parseDecimalFormat($duration),
|
||||
default => throw new \InvalidArgumentException(sprintf('Unsupported duration format "%s"', $mode)),
|
||||
default => throw new \InvalidArgumentException(\sprintf('Unsupported duration format "%s"', $mode)),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ final class Duration
|
||||
$parts = explode(':', $duration);
|
||||
if (\count($parts) < 2 || \count($parts) > 3) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf('Invalid colon format given in "%s"', $duration)
|
||||
\sprintf('Invalid colon format given in "%s"', $duration)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -124,13 +124,13 @@ final class Duration
|
||||
foreach ($parts as $part) {
|
||||
if (\strlen($part) === 0) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf('Colon format cannot parse "%s"', $duration)
|
||||
\sprintf('Colon format cannot parse "%s"', $duration)
|
||||
);
|
||||
}
|
||||
// the entire time could be negative
|
||||
if ($i++ > 0 && ((int) $part) < 0) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf('Negative input is not allowed in "%s"', $duration)
|
||||
\sprintf('Negative input is not allowed in "%s"', $duration)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,11 +40,11 @@ final class FileHelper
|
||||
$this->makeDir($directory);
|
||||
|
||||
if (!is_dir($directory)) {
|
||||
throw new \Exception(sprintf('Directory "%s" does not exist', $directory));
|
||||
throw new \Exception(\sprintf('Directory "%s" does not exist', $directory));
|
||||
}
|
||||
|
||||
if (!is_writable($directory)) {
|
||||
throw new \Exception(sprintf('Directory "%s" is not writable', $directory));
|
||||
throw new \Exception(\sprintf('Directory "%s" is not writable', $directory));
|
||||
}
|
||||
|
||||
return $directory;
|
||||
|
||||
@@ -39,9 +39,9 @@ final class PaginationTemplate extends TwitterBootstrap5Template
|
||||
protected function linkLi(string $class, string $href, $text, ?string $rel = null): string
|
||||
{
|
||||
$liClass = implode(' ', array_filter(['page-item', $class]));
|
||||
$rel = $rel ? sprintf(' rel="%s"', $rel) : '';
|
||||
$rel = $rel ? \sprintf(' rel="%s"', $rel) : '';
|
||||
|
||||
return sprintf('<li class="%s"><a class="page-link pagination-link" href="%s"%s>%s</a></li>', $liClass, $href, $rel, $text);
|
||||
return \sprintf('<li class="%s"><a class="page-link pagination-link" href="%s"%s>%s</a></li>', $liClass, $href, $rel, $text);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,7 +53,7 @@ final class PaginationTemplate extends TwitterBootstrap5Template
|
||||
{
|
||||
$liClass = implode(' ', array_filter(['page-item', $class]));
|
||||
|
||||
return sprintf('<li class="%s"><span class="page-link pagination-link">%s</span></li>', $liClass, $text);
|
||||
return \sprintf('<li class="%s"><span class="page-link pagination-link">%s</span></li>', $liClass, $text);
|
||||
}
|
||||
|
||||
public function current(int $page): string
|
||||
|
||||
Reference in New Issue
Block a user