Skip to content

Commit 43d7b66

Browse files
committed
Use root namespace for std functions explicitly
1 parent 05a7acf commit 43d7b66

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Structs/NormalizedSlice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function getStep(): int
6565
*/
6666
public function count(): int
6767
{
68-
return intval(ceil(abs((($this->end - $this->start) / $this->step))));
68+
return \intval(\ceil(\abs((($this->end - $this->start) / $this->step))));
6969
}
7070

7171
/**

src/Structs/Slice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static function toSlice($s): Slice
4747
}
4848

4949
if (!self::isSliceString($s)) {
50-
$str = \is_scalar($s) ? "{$s}" : gettype($s);
50+
$str = \is_scalar($s) ? "{$s}" : \gettype($s);
5151
throw new ValueError("Invalid slice: \"{$str}\".");
5252
}
5353

src/Util.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Util
2626
*/
2727
public static function normalizeIndex(int $index, int $containerLength, bool $throwError = true): int
2828
{
29-
$dist = $index >= 0 ? $index : abs($index) - 1;
29+
$dist = $index >= 0 ? $index : \abs($index) - 1;
3030
if ($throwError && $dist >= $containerLength) {
3131
throw new IndexError("Index {$index} is out of range.");
3232
}
@@ -43,9 +43,9 @@ public static function normalizeIndex(int $index, int $containerLength, bool $th
4343
*/
4444
public static function isArraySequential(array $source, bool $forceCustomImplementation = false): bool
4545
{
46-
if (!function_exists('array_is_list') || $forceCustomImplementation) {
47-
return \count($source) === 0 || array_keys($source) === range(0, count($source) - 1);
46+
if (!\function_exists('array_is_list') || $forceCustomImplementation) {
47+
return \count($source) === 0 || \array_keys($source) === \range(0, \count($source) - 1);
4848
}
49-
return array_is_list($source);
49+
return \array_is_list($source);
5050
}
5151
}

0 commit comments

Comments
 (0)