src/Manager.php
protected function detectMetadataDriver($dir, $configPath)
	{
		foreach ((array) $configPath as $cPath)
		{
			$path = $dir.DS.$cPath.DS;

			if (($files = glob($path.'*.dcm.xml')) && count($files))
			{
				return 'xml';
			}
			elseif (($files = glob($path.'*.orm.xml')) && count($files))
			{
				return 'simplified_xml';
			}
			elseif (($files = glob($path.'*.dcm.yml')) && count($files))
			{
				return 'yml';
			}
			elseif (($files = glob($path.'*.orm.yml')) && count($files))
			{
				return 'simplified_yml';
			}
			elseif (($files = glob($path.'*.php')) && count($files))
			{
				return 'php';
			}
		}

		if (is_dir($dir.DS.$this->getClassPath().$this->getObjectName()))
		{
			return 'annotation';
		}

		return false;
	}
protected function detectMetadataDriver($dir, $configPath)
	{
		foreach ((array) $configPath as $cPath)
		{
			$path = $dir.DS.$cPath.DS;

			if (($files = glob($path.'*.dcm.xml')) && count($files))
			{
				return 'xml';
			}
			elseif (($files = glob($path.'*.orm.xml')) && count($files))
			{
				return 'simplified_xml';
			}
			elseif (($files = glob($path.'*.dcm.yml')) && count($files))
			{
				return 'yml';
			}
			elseif (($files = glob($path.'*.orm.yml')) && count($files))
			{
				return 'simplified_yml';
			}
			elseif (($files = glob($path.'*.php')) && count($files))
			{
				return 'php';
			}
		}

		if (is_dir($dir.DS.$this->getClassPath().$this->getObjectName()))
		{
			return 'annotation';
		}

		return false;
	}
Detects which metadata driver to use for the supplied directory

@param string       $dir        A directory path
@param string|array $configPath Config path or paths

@return string|null A metadata driver short name, if one can be detected