Skip to content

Commit

Permalink
Fixed issue #4: Strict error (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihor committed Feb 27, 2016
1 parent 17df17b commit de34f3c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nspl/a.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function last($sequence)
}

if (is_array($sequence)) {
return $sequence[count($sequence) - 1];
return end($sequence);
}
else {
foreach ($sequence as $item);
Expand Down
2 changes: 1 addition & 1 deletion nspl/args.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

error_reporting(E_STRICT);

require_once '../vendor/autoload.php';
require_once '../autoload.php';

0 comments on commit de34f3c

Please # to comment.