protected function toNumber($value)
    {
        if (is_numeric($value)) {
            return $value + 0; // cast to number
        }
        if (is_bool($value) || is_null($value)) {
            return (int) $value;
        }
        if ($this->getTypeCheck()->isArray($value) && count($value) === 1) {
            return $this->toNumber(reset($value));
        }

        return $value;
    }
protected function toNumber($value)
    {
        if (is_numeric($value)) {
            return $value + 0; // cast to number
        }
        if (is_bool($value) || is_null($value)) {
            return (int) $value;
        }
        if ($this->getTypeCheck()->isArray($value) && count($value) === 1) {
            return $this->toNumber(reset($value));
        }

        return $value;
    }
protected function toNumber ( $ value ) { if ( is_numeric ( $ value ) ) { return $ value + 0 ; // cast to number } if ( is_bool ( $ value ) || is_null ( $ value ) ) { return ( int ) $ value ; } if ( $ this -> getTypeCheck ( ) -> isArray ( $ value ) && count ( $ value ) === 1 ) { return $ this -> toNumber ( reset ( $ value ) ) ; } return $ value ; }
Converts a value to a number. For example, "4.5" becomes 4.5.

@param mixed $value the value to convert to a number

@return int|float|mixed
Converts a value to a number . For example 4 . 5 becomes 4 . 5 .