Skip to content

Commit 11e1157

Browse files
committed
cs
1 parent 19b80bc commit 11e1157

9 files changed

+17
-17
lines changed

src/Utils/Arrays.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ public static function flatten(array $array, bool $preserveKeys = false): array
277277
*/
278278
public static function isList(mixed $value): bool
279279
{
280-
return is_array($value) && (PHP_VERSION_ID < 80100
280+
return is_array($value) && (
281+
PHP_VERSION_ID < 80100
281282
? !$value || array_keys($value) === range(0, count($value) - 1)
282283
: array_is_list($value)
283284
);

src/Utils/FileSystem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public static function makeWritable(string $path, int $dirMode = 0777, int $file
271271
*/
272272
public static function isAbsolute(string $path): bool
273273
{
274-
return (bool) preg_match('#([a-z]:)?[/\\\\]|[a-z][a-z0-9+.-]*://#Ai', $path);
274+
return (bool) preg_match('#([a-z]:)?[/\\\]|[a-z][a-z0-9+.-]*://#Ai', $path);
275275
}
276276

277277

@@ -280,7 +280,7 @@ public static function isAbsolute(string $path): bool
280280
*/
281281
public static function normalizePath(string $path): string
282282
{
283-
$parts = $path === '' ? [] : preg_split('~[/\\\\]+~', $path);
283+
$parts = $path === '' ? [] : preg_split('~[/\\\]+~', $path);
284284
$res = [];
285285
foreach ($parts as $part) {
286286
if ($part === '..' && $res && end($res) !== '..' && end($res) !== '') {

src/Utils/Strings.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,6 @@ public static function split(
547547
return $utf8 && $captureOffset
548548
? self::bytesToChars($subject, [$m])[0]
549549
: $m;
550-
551550
}
552551

553552

src/Utils/Type.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ private function allows3(array $types, array $subtypes): bool
260260
$subtypes,
261261
fn($subtype) => Validators::isBuiltinType($type)
262262
? strcasecmp($type, $subtype) === 0
263-
: is_a($subtype, $type, allow_string: true)
264-
)
263+
: is_a($subtype, $type, allow_string: true),
264+
),
265265
);
266266
}
267267
}

tests/Utils/Arrays.filter().phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ Assert::same(
3232
['a' => 1, 'b' => 2, 'c' => 3],
3333
Arrays::filter(
3434
['a' => 1, 'b' => 2, 'c' => 3],
35-
fn($v, $k, $a) => $a === ['a' => 1, 'b' => 2, 'c' => 3]
35+
fn($v, $k, $a) => $a === ['a' => 1, 'b' => 2, 'c' => 3],
3636
),
3737
);
3838

3939
Assert::same(
4040
[],
41-
Arrays::filter([], fn() => true)
41+
Arrays::filter([], fn() => true),
4242
);

tests/Utils/FileSystem.normalizePath.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test('', function () {
2121
Assert::same("{$S}file", FileSystem::normalizePath('/file'));
2222

2323
Assert::same('', FileSystem::normalizePath('.'));
24-
Assert::same($S, FileSystem::normalizePath('\\.'));
24+
Assert::same($S, FileSystem::normalizePath('\.'));
2525
Assert::same($S, FileSystem::normalizePath('/.'));
2626
Assert::same($S, FileSystem::normalizePath('.\\'));
2727
Assert::same($S, FileSystem::normalizePath('./'));

tests/Utils/Reflection.getParameterDefaultValue.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Assert::exception(
4343
Assert::exception(
4444
fn() => Reflection::getParameterDefaultValue(new ReflectionParameter(['NS\Foo', 'method'], 'j')),
4545
ReflectionException::class,
46-
'Unable to resolve constant NS\\Foo::UNDEFINED used as default value of $j in NS\Foo::method().',
46+
'Unable to resolve constant NS\Foo::UNDEFINED used as default value of $j in NS\Foo::method().',
4747
);
4848

4949
Assert::same(NS\Bar::DEFINED, Reflection::getParameterDefaultValue(new ReflectionParameter(['NS\Foo', 'method'], 'k')));

tests/Utils/Validators.isTypeDeclaration.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Assert::true(Validators::isTypeDeclaration('string'));
1616
Assert::true(Validators::isTypeDeclaration('?string'));
1717
Assert::true(Validators::isTypeDeclaration('string|null'));
1818
Assert::true(Validators::isTypeDeclaration('Bar€'));
19-
Assert::true(Validators::isTypeDeclaration('\\Bar€'));
20-
Assert::true(Validators::isTypeDeclaration('Bar€\\Baz'));
21-
Assert::true(Validators::isTypeDeclaration('\\Bar€\\Baz'));
19+
Assert::true(Validators::isTypeDeclaration('\Bar€'));
20+
Assert::true(Validators::isTypeDeclaration('Bar€\Baz'));
21+
Assert::true(Validators::isTypeDeclaration('\Bar€\Baz'));
2222
Assert::true(Validators::isTypeDeclaration('A&B&C'));
2323
Assert::true(Validators::isTypeDeclaration('(A&C)|(C&D)|true'));
2424

@@ -27,9 +27,9 @@ Assert::false(Validators::isTypeDeclaration('?'));
2727
Assert::false(Validators::isTypeDeclaration(''));
2828
Assert::false(Validators::isTypeDeclaration('Bar*'));
2929
Assert::false(Validators::isTypeDeclaration('1a'));
30-
Assert::false(Validators::isTypeDeclaration('\\\\X'));
30+
Assert::false(Validators::isTypeDeclaration('\\\X'));
3131
Assert::false(Validators::isTypeDeclaration('X\\'));
32-
Assert::false(Validators::isTypeDeclaration('A\\\\X'));
32+
Assert::false(Validators::isTypeDeclaration('A\\\X'));
3333
Assert::false(Validators::isTypeDeclaration('|foo'));
3434
Assert::false(Validators::isTypeDeclaration('(A|B)'));
3535
Assert::false(Validators::isTypeDeclaration('(A&B)'));

tests/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ function getTempDir(): string
2020
{
2121
$dir = __DIR__ . '/tmp/' . getmypid();
2222

23-
if (empty($GLOBALS['\\lock'])) {
23+
if (empty($GLOBALS['\lock'])) {
2424
// garbage collector
25-
$GLOBALS['\\lock'] = $lock = fopen(__DIR__ . '/lock', 'w');
25+
$GLOBALS['\lock'] = $lock = fopen(__DIR__ . '/lock', 'w');
2626
if (rand(0, 100)) {
2727
flock($lock, LOCK_SH);
2828
@mkdir(dirname($dir));

0 commit comments

Comments
 (0)