public function addResult(ResultInterface $result, string $name = null): ContainerResult
    {
        $this->valid = $this->isValid() && $result->isValid();

        if (is_string($name) === true) {
            $this->results[$name] = $result;
        } else {
            $this->results[] = $result;
        }

        return $this;
    }
public function addResult(ResultInterface $result, string $name = null): ContainerResult
    {
        $this->valid = $this->isValid() && $result->isValid();

        if (is_string($name) === true) {
            $this->results[$name] = $result;
        } else {
            $this->results[] = $result;
        }

        return $this;
    }
public function addResult ( ResultInterface $ result , string $ name = null ) : ContainerResult { $ this -> valid = $ this -> isValid ( ) && $ result -> isValid ( ) ; if ( is_string ( $ name ) === true ) { $ this -> results [ $ name ] = $ result ; } else { $ this -> results [ ] = $ result ; } return $ this ; }
Add result to container.

@param ResultInterface $result
@param string|null     $name
@return ContainerResult
Add result to container .