public function addParameter($key, $data)
    {
        if (!is_string($key)) {
            throw new \RuntimeException('Only strings can be given as parameter keys. Got "' . gettype($key) . '".');
        }

        if (!is_string($data) && !is_callable($data)) {
            throw new \RuntimeException('The "data" parameter must either be a string or a callable. . Got "' . gettype($key) . '".');
        }

        if (isset($this->parameters[$key])) {
            throw new \RuntimeException('The parameter key "' . $key . '" is already set.');
        }

        $this->parameters[$key] = $data;

        return $this;
    }
public function addParameter($key, $data)
    {
        if (!is_string($key)) {
            throw new \RuntimeException('Only strings can be given as parameter keys. Got "' . gettype($key) . '".');
        }

        if (!is_string($data) && !is_callable($data)) {
            throw new \RuntimeException('The "data" parameter must either be a string or a callable. . Got "' . gettype($key) . '".');
        }

        if (isset($this->parameters[$key])) {
            throw new \RuntimeException('The parameter key "' . $key . '" is already set.');
        }

        $this->parameters[$key] = $data;

        return $this;
    }
public function addParameter ( $ key , $ data ) { if ( ! is_string ( $ key ) ) { throw new \ RuntimeException ( 'Only strings can be given as parameter keys. Got "' . gettype ( $ key ) . '".' ) ; } if ( ! is_string ( $ data ) && ! is_callable ( $ data ) ) { throw new \ RuntimeException ( 'The "data" parameter must either be a string or a callable. . Got "' . gettype ( $ key ) . '".' ) ; } if ( isset ( $ this -> parameters [ $ key ] ) ) { throw new \ RuntimeException ( 'The parameter key "' . $ key . '" is already set.' ) ; } $ this -> parameters [ $ key ] = $ data ; return $ this ; }
Adds a parameter that can occur in Fact texts.
@param string $key This is the key which will be searched for in the text.
@param string|Callable $data
@throws \RuntimeException if a parameter with the given $key was already
added.
@return $this
Adds a parameter that can occur in Fact texts .