protected function getReferencesInDirectory($path, $flags = 0)
{
$basePath = rtrim($path, '/');
return $this->getReferencesForRegex($basePath . '/', '~^' . preg_quote($basePath, '~') . '/[^/]+$~', $flags, $this->getPathDepth($path) + 1);
}