diff --git a/src/PHPCodeSniffer/Finder.php b/src/PHPCodeSniffer/Finder.php index 7c8324e3167fa0f2490beb4669114b1e705da57f..714e5ee59e7d64261e94de7725a1849e86c761cb 100644 --- a/src/PHPCodeSniffer/Finder.php +++ b/src/PHPCodeSniffer/Finder.php @@ -51,7 +51,10 @@ class Finder */ public function in($path) { - $finder = SymfonyFinder::create()->files()->in($path)->name('ruleset.xml'); + $finder = $this->getSymfonyFinder() + ->in($path) + ->files() + ->name('ruleset.xml'); $paths = iterator_to_array($finder, false); $paths = array_map( function (SplFileInfo $file) { @@ -63,6 +66,16 @@ class Finder return $this->createStandardsFromPaths($paths); } + /** + * Creates new symfony finder instance. + * + * @return SymfonyFinder + */ + protected function getSymfonyFinder() + { + return SymfonyFinder::create(); + } + /** * Creates PHPCodeSniffer standards from paths. *