protected function extractPath(string $path)
{
try {
$xml = simplexml_import_dom(XmlUtils::loadFile($path, self::RESOURCE_SCHEMA));
} catch (\InvalidArgumentException $e) {
throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
}
foreach ($xml->resource as $resource) {
$resourceClass = (string) $resource['class'];
$this->resources[$resourceClass] = ['shortName' => $this->phpize($resource, 'shortName', 'string'), 'description' => $this->phpize($resource, 'description', 'string'), 'iri' => $this->phpize($resource, 'iri', 'string'), 'itemOperations' => $this->getAttributes($resource, 'itemOperation') ?: null, 'collectionOperations' => $this->getAttributes($resource, 'collectionOperation') ?: null, 'attributes' => $this->getAttributes($resource, 'attribute') ?: null, 'properties' => $this->getProperties($resource) ?: null];
}
}