diff --git a/nspl/a.php b/nspl/a.php index 017f2e0..8b0a782 100644 --- a/nspl/a.php +++ b/nspl/a.php @@ -344,7 +344,7 @@ function last($sequence) } if (is_array($sequence)) { - return $sequence[count($sequence) - 1]; + return end($sequence); } else { foreach ($sequence as $item); diff --git a/nspl/args.php b/nspl/args.php index 54ea26a..a2df621 100644 --- a/nspl/args.php +++ b/nspl/args.php @@ -654,7 +654,7 @@ public static function getFor($type, $onlyOr = false) $default = class_exists($type) || interface_exists($type) ? $type - : implode(' ', array_map('strtolower', preg_split('/(?=[A-Z])/', end(explode('\\', $type))))); + : implode(' ', array_map('strtolower', preg_split('/(?=[A-Z])/', a\last(explode('\\', $type))))); return a\value(self::$messages, $type, 'be ' . $default); } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 01f5f5b..a94571d 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,4 +1,6 @@