public function define(string $resource, $versionOrClosure, $closureOrDescription = null, string $description = null)
    {
        $version = $this->version;
        $closure = $closureOrDescription;

        if ($versionOrClosure instanceof \Closure) {
            $version = $this->version;
            $closure = $versionOrClosure;
            $description = $closureOrDescription;
        }

        if (is_numeric($versionOrClosure)) {
            $version = intval($versionOrClosure);
        }

        $this->definitions->push(new ResourceDefinition($version, $resource, $description));

        $resourceDefinition = $this->definition($resource, $version);
        call_user_func_array($closure, [$resourceDefinition]);

        return $this;
    }