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;
    }