public function castItemValueToProperType($value)
    {
        $normalized = $value;

        if (in_array($value, ['true', 'on', 'yes']))
        {
            $normalized = true;
        }
        elseif (in_array($value, ['false', 'off', 'no', 'none']))
        {
            $normalized = false;
        }
        elseif ('null' == $value)
        {
            $normalized = null;
        }
        elseif (is_numeric($value))
        {
            $number = $value + 0;
            if (intval($number) == $number)
            {
                $normalized = (int)$number;
            }
            elseif (floatval($number) == $number)
            {
                $normalized = (float)$number;
            }
        }
        elseif (is_array($value))
        {
            foreach ($value as $itemKey => $itemValue)
            {
                $normalized[$itemKey] = $this->castItemValueToProperType($itemValue);
            }
        }
        return $normalized;
    }
public function castItemValueToProperType($value)
    {
        $normalized = $value;

        if (in_array($value, ['true', 'on', 'yes']))
        {
            $normalized = true;
        }
        elseif (in_array($value, ['false', 'off', 'no', 'none']))
        {
            $normalized = false;
        }
        elseif ('null' == $value)
        {
            $normalized = null;
        }
        elseif (is_numeric($value))
        {
            $number = $value + 0;
            if (intval($number) == $number)
            {
                $normalized = (int)$number;
            }
            elseif (floatval($number) == $number)
            {
                $normalized = (float)$number;
            }
        }
        elseif (is_array($value))
        {
            foreach ($value as $itemKey => $itemValue)
            {
                $normalized[$itemKey] = $this->castItemValueToProperType($itemValue);
            }
        }
        return $normalized;
    }
public function castItemValueToProperType ( $ value ) { $ normalized = $ value ; if ( in_array ( $ value , [ 'true' , 'on' , 'yes' ] ) ) { $ normalized = true ; } elseif ( in_array ( $ value , [ 'false' , 'off' , 'no' , 'none' ] ) ) { $ normalized = false ; } elseif ( 'null' == $ value ) { $ normalized = null ; } elseif ( is_numeric ( $ value ) ) { $ number = $ value + 0 ; if ( intval ( $ number ) == $ number ) { $ normalized = ( int ) $ number ; } elseif ( floatval ( $ number ) == $ number ) { $ normalized = ( float ) $ number ; } } elseif ( is_array ( $ value ) ) { foreach ( $ value as $ itemKey => $ itemValue ) { $ normalized [ $ itemKey ] = $ this -> castItemValueToProperType ( $ itemValue ) ; } } return $ normalized ; }
Cast item string value to proper type

@param string $value

@return array|string|bool|int|float|null
Cast item string value to proper type