Fixed indentation
Simplify params processing by using local variable
Reindent some lines
Better variable name
Separete checks for numeric and all and directly convert value
Function isset already returns boolean, no need to process it again
Wrap long line
Fix indentation