protected function addStoredValues($string)
    {
        preg_match_all('/\{stored\[(.*?)\]\}/si', $string, $matches);

        $length = count($matches[0]);

        for ($i = 0; $i < $length; $i++) {
            $parts = explode('][', $matches[1][$i]);
            $value = $this->storedResult;
            foreach ($parts as $part) {
                if (isset($value[$part])) {
                    $value = $value[$part];
                }
            }

            $string = str_replace($matches[0][$i], $value, $string);
        }

        return $string;
    }