public function setResult($name = null, $result = null)
    {
        if (null === $result) {
            $result = $name;
            array_push($this->results, $result);

            return $this;
        }

        $this->results[(string) $name] = $result;

        return $this;
    }
public function setResult($name = null, $result = null)
    {
        if (null === $result) {
            $result = $name;
            array_push($this->results, $result);

            return $this;
        }

        $this->results[(string) $name] = $result;

        return $this;
    }
public function setResult ( $ name = null , $ result = null ) { if ( null === $ result ) { $ result = $ name ; array_push ( $ this -> results , $ result ) ; return $ this ; } $ this -> results [ ( string ) $ name ] = $ result ; return $ this ; }
Sets event result.

Any listener can store in instance of event some result.
If the result is not named, it is added to the results stack.

@param string $name   Optional; the name of result
@param mixed  $result The result value

@return AbstractEvent
Sets event result .