Skip to content

Commit

Permalink
removed N::isIntLike, becasue it's esentially the same as is_numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
meszaros-lajos-gyorgy committed Jul 28, 2021
1 parent 4d16277 commit f8f46b9
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/N.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@
namespace Shovel;

class N {
// N::isIntLike('12') // true
// N::isIntLike(3.14) // true
// N::isIntLike(7) // true
// N::isIntLike('23.5') // false
// N::isIntLike([1, 2, 3]) // false
public static function isIntLike($n): bool
{
return is_int($n) || is_float($n) || (is_string($n) && intval($n) . '' === $n);
}

public static function toInt($n): ?int
{
return $n === null ? null : intval($n);
Expand Down

0 comments on commit f8f46b9

Please sign in to comment.