public function decode($string)
    {
        if ($this->isSerialized($string)) {
            return $this->unserialize($string);
        }

        $result = json_decode($string, true);
        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new \InvalidArgumentException('Unable to unserialize value.');
        }

        return $result;
    }
public function decode($string)
    {
        if ($this->isSerialized($string)) {
            return $this->unserialize($string);
        }

        $result = json_decode($string, true);
        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new \InvalidArgumentException('Unable to unserialize value.');
        }

        return $result;
    }
public function decode ( $ string ) { if ( $ this -> isSerialized ( $ string ) ) { return $ this -> unserialize ( $ string ) ; } $ result = json_decode ( $ string , true ) ; if ( json_last_error ( ) !== JSON_ERROR_NONE ) { throw new \ InvalidArgumentException ( 'Unable to unserialize value.' ) ; } return $ result ; }
Unserialize the given string

@param string $string

@return string|int|float|bool|array|null
@throws \InvalidArgumentException
Unserialize the given string