Gets fallback metadata name.
string $name: Configuration name or key.
null|string Same name with the last part(s) replaced by the filesystem marker. for example, breakpoint.breakpoint.module.toolbar.narrow check for definition in below order: breakpoint.breakpoint.module.toolbar.* breakpoint.breakpoint.module.*.* breakpoint.breakpoint.*.*.* breakpoint.*.*.*.* Returns null, if no matching element.
protected function getFallbackName($name) {
// Check for definition of $name with filesystem marker.
$replaced = preg_replace('/(\\.[^\\.]+)([\\.\\*]*)$/', '.*\\2', $name);
if ($replaced != $name) {
if (isset($this->definitions[$replaced])) {
return $replaced;
}
else {
// No definition for this level(for example, breakpoint.breakpoint.*),
// check for next level (which is, breakpoint.*.*).
return self::getFallbackName($replaced);
}
}
}