private function recurseAndParseSchemas($array, $rootDir)
{
foreach ($array as $key => &$value) {
if (is_array($value)) {
if (isset($value['schema'])) {
if (in_array($key, array_keys($this->schemaParsers))) {
$schemaParser = $this->schemaParsers[$key];
$fileDir = $this->getCachedFilePath($value['schema']);
$schemaParser->setSourceUri('file:' . ($fileDir ? $fileDir : $rootDir . DIRECTORY_SEPARATOR));
$value['schema'] = $schemaParser->createSchemaDefinition($value['schema']);
} else {
throw new InvalidSchemaTypeException($key);
}
} else {
$value = $this->recurseAndParseSchemas($value, $rootDir);
}
}
}
return $array;
}