src/Request.php
protected function stringToArray($string)
    {
        if (!$string || !is_string($string)) {
            return [];
        }

        $result = $this->getReaderFactory()->read($string);
        if ($result) {
            return $result;
        }

        $array = [];
        $array['text'] = $string;
        return $array;
    }
protected function stringToArray($string)
    {
        if (!$string || !is_string($string)) {
            return [];
        }

        $result = $this->getReaderFactory()->read($string);
        if ($result) {
            return $result;
        }

        $array = [];
        $array['text'] = $string;
        return $array;
    }
Tries to turn a string of data into an array.

This method uses a ReaderFactory that will attempt to read the sting
as a number of predefined strings, accepting the first one that returns
something. Failing all else, if there was a string it will return an
array with the text attached to a 'text' key
eg. $this->stringToArray('fail')['body'] == 'fail'

@param string $string
@return array