public function decode($data)
    {
        if (is_string($data)) {
            $this->arrayData = json_decode($data, true); // true gives us associative arrays
        }

        if (!is_string($data) || !$this->isValidJson()) {
            throw new JsonDecodingFailedException('The data provided was not proper JSON');
        }

        return $this->arrayData;
    }
public function decode($data)
    {
        if (is_string($data)) {
            $this->arrayData = json_decode($data, true); // true gives us associative arrays
        }

        if (!is_string($data) || !$this->isValidJson()) {
            throw new JsonDecodingFailedException('The data provided was not proper JSON');
        }

        return $this->arrayData;
    }
public function decode ( $ data ) { if ( is_string ( $ data ) ) { $ this -> arrayData = json_decode ( $ data , true ) ; // true gives us associative arrays } if ( ! is_string ( $ data ) || ! $ this -> isValidJson ( ) ) { throw new JsonDecodingFailedException ( 'The data provided was not proper JSON' ) ; } return $ this -> arrayData ; }
Decodes JSON data to array

@param $data string
@return array
@throws JsonDecodingFailedException
Decodes JSON data to array