protected function extractPath(string $path)
{
try {
$resourcesYaml = Yaml::parse(file_get_contents($path));
} catch (ParseException $e) {
$e->setParsedFile($path);
throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
}
if (null === ($resourcesYaml = $resourcesYaml['resources'] ?? $resourcesYaml)) {
return;
}
if (!is_array($resourcesYaml)) {
throw new InvalidArgumentException(sprintf('"resources" setting is expected to be null or an array, %s given in "%s".', gettype($resourcesYaml), $path));
}
$this->extractResources($resourcesYaml, $path);
}