IntegerΒΆ

Ensure that variable has value that can be treated as integer value. Variable is validated and converted to integer on success.

Correct:

1     => 1
'1'   => 1
'-1'  => -1

Incorect:

null
1.1
'one'
false
true
[]

All above values will throw \InvalidArgumentException