protected function addHelpResource($key, $resource)
    {
        if (isset($this->helpResources[$key])) {
            throw new \LogicException('The resource you are trying to add is already set.');
        }

        if (false === is_object(($resource))) {
            throw new \InvalidArgumentException(sprintf('The resource "%s" you are trying to add is not an object. addHelpResource() accepts only objects. Use addHelpValue() to store other kind of values.', $key));
        }

        $this->helpResources[$key] = $resource;

        return $this;
    }