protected function castToObject($value)
    {
        if (is_scalar($value) || is_resource($value)) {
            $value = $this->dontCast($value);
        }

        return (object)$value;
    }
protected function castToObject($value)
    {
        if (is_scalar($value) || is_resource($value)) {
            $value = $this->dontCast($value);
        }

        return (object)$value;
    }
protected function castToObject ( $ value ) { if ( is_scalar ( $ value ) || is_resource ( $ value ) ) { $ value = $ this -> dontCast ( $ value ) ; } return ( object ) $ value ; }
Cast value to a object

@return object|mixed
Cast value to a object