public function toObject($string): stdClass
    {
        if (is_string($string)) {
            return $this->jsonDecode($string);
        }

        return $this->jsonDecode($this->jsonEncode($string));
    }
public function toObject($string): stdClass
    {
        if (is_string($string)) {
            return $this->jsonDecode($string);
        }

        return $this->jsonDecode($this->jsonEncode($string));
    }
public function toObject ( $ string ) : stdClass { if ( is_string ( $ string ) ) { return $ this -> jsonDecode ( $ string ) ; } return $ this -> jsonDecode ( $ this -> jsonEncode ( $ string ) ) ; }
Convert to object.

@param mixed $string

@return stdClass
Convert to object .