Skip to content

Commit f0ce0bd

Browse files
CS fixes
1 parent 73e2c69 commit f0ce0bd

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

AbstractString.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function containsAny(string|iterable $needle): bool
263263
public function endsWith(string|iterable $suffix): bool
264264
{
265265
if (\is_string($suffix)) {
266-
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
266+
throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
267267
}
268268

269269
foreach ($suffix as $s) {
@@ -312,7 +312,7 @@ public function ensureStart(string $prefix): static
312312
public function equalsTo(string|iterable $string): bool
313313
{
314314
if (\is_string($string)) {
315-
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
315+
throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
316316
}
317317

318318
foreach ($string as $s) {
@@ -340,7 +340,7 @@ public function ignoreCase(): static
340340
public function indexOf(string|iterable $needle, int $offset = 0): ?int
341341
{
342342
if (\is_string($needle)) {
343-
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
343+
throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
344344
}
345345

346346
$i = \PHP_INT_MAX;
@@ -362,7 +362,7 @@ public function indexOf(string|iterable $needle, int $offset = 0): ?int
362362
public function indexOfLast(string|iterable $needle, int $offset = 0): ?int
363363
{
364364
if (\is_string($needle)) {
365-
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
365+
throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
366366
}
367367

368368
$i = null;
@@ -414,7 +414,7 @@ abstract public function prepend(string ...$prefix): static;
414414
public function repeat(int $multiplier): static
415415
{
416416
if (0 > $multiplier) {
417-
throw new InvalidArgumentException(sprintf('Multiplier must be positive, %d given.', $multiplier));
417+
throw new InvalidArgumentException(\sprintf('Multiplier must be positive, %d given.', $multiplier));
418418
}
419419

420420
$str = clone $this;
@@ -481,7 +481,7 @@ public function split(string $delimiter, ?int $limit = null, ?int $flags = null)
481481
public function startsWith(string|iterable $prefix): bool
482482
{
483483
if (\is_string($prefix)) {
484-
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
484+
throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
485485
}
486486

487487
foreach ($prefix as $prefix) {

AbstractUnicodeString.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function ascii(array $rules = []): self
124124
}
125125

126126
if (null === $transliterator) {
127-
throw new InvalidArgumentException(sprintf('Unknown transliteration rule "%s".', $rule));
127+
throw new InvalidArgumentException(\sprintf('Unknown transliteration rule "%s".', $rule));
128128
}
129129

130130
self::$transliterators['any-latin/bgn'] = $transliterator;
@@ -142,7 +142,7 @@ public function ascii(array $rules = []): self
142142
$c = (string) iconv('UTF-8', 'ASCII//TRANSLIT', $c[0]);
143143

144144
if ('' === $c && '' === iconv('UTF-8', 'ASCII//TRANSLIT', '²')) {
145-
throw new \LogicException(sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class));
145+
throw new \LogicException(\sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class));
146146
}
147147

148148
return 1 < \strlen($c) ? ltrim($c, '\'`"^~') : ('' !== $c ? $c : '?');

ByteString.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(string $string = '')
4545
public static function fromRandom(int $length = 16, ?string $alphabet = null): self
4646
{
4747
if ($length <= 0) {
48-
throw new InvalidArgumentException(sprintf('A strictly positive length is expected, "%d" given.', $length));
48+
throw new InvalidArgumentException(\sprintf('A strictly positive length is expected, "%d" given.', $length));
4949
}
5050

5151
$alphabet ??= self::ALPHABET_ALPHANUMERIC;
@@ -436,7 +436,7 @@ public function toCodePointString(?string $fromEncoding = null): CodePointString
436436
}
437437

438438
if (!$validEncoding) {
439-
throw new InvalidArgumentException(sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252'));
439+
throw new InvalidArgumentException(\sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252'));
440440
}
441441

442442
$u->string = mb_convert_encoding($this->string, 'UTF-8', $fromEncoding ?? 'Windows-1252');

LazyString.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class LazyString implements \Stringable, \JsonSerializable
2626
public static function fromCallable(callable|array $callback, mixed ...$arguments): static
2727
{
2828
if (\is_array($callback) && !\is_callable($callback) && !(($callback[0] ?? null) instanceof \Closure || 2 < \count($callback))) {
29-
throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, '['.implode(', ', array_map('get_debug_type', $callback)).']'));
29+
throw new \TypeError(\sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, '['.implode(', ', array_map('get_debug_type', $callback)).']'));
3030
}
3131

3232
$lazyString = new static();
@@ -94,7 +94,7 @@ public function __toString(): string
9494
$r = new \ReflectionFunction($this->value);
9595
$callback = $r->getStaticVariables()['callback'];
9696

97-
$e = new \TypeError(sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type));
97+
$e = new \TypeError(\sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type));
9898
}
9999

100100
throw $e;

Resources/WcswidthDataGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private function write(string $fileName, string $version, array $rawData): void
7373
$content = $this->getHeader($version).'return '.VarExporter::export($this->format($rawData)).";\n";
7474

7575
if (!file_put_contents($this->outDir.'/'.$fileName, $content)) {
76-
throw new RuntimeException(sprintf('The "%s" file could not be written.', $fileName));
76+
throw new RuntimeException(\sprintf('The "%s" file could not be written.', $fileName));
7777
}
7878
}
7979

Resources/bin/update-data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
error_reporting(\E_ALL);
1919

2020
set_error_handler(static function (int $type, string $msg, string $file, int $line): void {
21-
throw new \ErrorException($msg, 0, $type, $file, $line);
21+
throw new ErrorException($msg, 0, $type, $file, $line);
2222
});
2323

2424
set_exception_handler(static function (Throwable $exception): void {

Slugger/AsciiSlugger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function getLocale(): string
9595
public function withEmoji(bool|string $emoji = true): static
9696
{
9797
if (false !== $emoji && !class_exists(EmojiTransliterator::class)) {
98-
throw new \LogicException(sprintf('You cannot use the "%s()" method as the "symfony/intl" package is not installed. Try running "composer require symfony/intl".', __METHOD__));
98+
throw new \LogicException(\sprintf('You cannot use the "%s()" method as the "symfony/intl" package is not installed. Try running "composer require symfony/intl".', __METHOD__));
9999
}
100100

101101
$new = clone $this;

Tests/Slugger/AsciiSluggerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public static function provideSlugEmojiTests(): iterable
112112
*/
113113
public function testSlugEmojiWithSetLocale()
114114
{
115-
if (!setlocale(LC_ALL, 'C.UTF-8')) {
115+
if (!setlocale(\LC_ALL, 'C.UTF-8')) {
116116
$this->markTestSkipped('Unable to switch to the "C.UTF-8" locale.');
117117
}
118118

0 commit comments

Comments
 (0)