private function parseResource()
    {
        if ($this->isArray($this->resource)) {
            return StdObjectWrapper::toArray($this->resource);
        } elseif ($this->isString($this->resource)) {
            return Yaml::parse($this->resource);
        } elseif ($this->isInstanceOf($this->resource, ConfigObject::class)) {
            return $this->resource->toArray();
        }

        throw new SymfonyYamlException(SymfonyYamlException::UNABLE_TO_PARSE, [gettype($this->resource)]);
    }