• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/cli/ormannotatecommand.php
  • Класс: BitrixMainCliOrmAnnotateCommand
  • Вызов: OrmAnnotateCommand::scanDir
protected function scanDir($dir, InputInterface $input, OutputInterface $output)
{
	$this->debug($output,'scan dir: '.$dir);

	$this->registerFallbackAutoload();

	foreach (
		$iterator = new RecursiveIteratorIterator(
			new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS | RecursiveDirectoryIterator::FOLLOW_SYMLINKS),
			RecursiveIteratorIterator::SELF_FIRST) as $item
	)
	{
		// check for stop list
		foreach ($this->excludedFiles as $excludedFile)
		{
			$currentPath = str_replace('\', '/', $item->getPathname());
			if (mb_substr($currentPath, -mb_strlen($excludedFile)) === $excludedFile)
			{
				continue 2;
			}
		}

		/** @var $iterator RecursiveDirectoryIterator */
		/** @var $item SplFileInfo */
		if ($item->isFile() && $item->isReadable() && mb_substr($item->getFilename(), -4) == '.php')
		{
			$this->debug($output,'handle file: '.$item->getPathname());

			try
			{
				// get classes from file
				include_once $item->getPathname();
				$this->filesIncluded++;

				$classes = $this->getDeclaredClassesDiff();

				// check classes
				$this->handleClasses($classes, $input, $output);
			}
			catch (Throwable $e) // php7
			{
				$this->debug($output, $e->getMessage());
			}
			catch (Exception $e) // php5
			{
				$this->debug($output, $e->getMessage());
			}
		}
	}
}