private function resourceName()
    {
        if ($this->routingAnnotations()->hasName()) {
            return $this->routingAnnotations()->name();
        }

        if (is_string($this->target) && class_exists($this->target)) {
            return substr(
                    $this->target,
                    strrpos($this->target, '\\') + 1
            );
        } elseif (!is_callable($this->target) && is_object($this->target)) {
            return substr(
                    get_class($this->target),
                    strrpos(get_class($this->target), '\\') + 1
            );
        }

        return null;
    }