diff --git a/src/PHPCodeSniffer/Finder.php b/src/PHPCodeSniffer/Finder.php index 714e5ee59e7d64261e94de7725a1849e86c761cb..14010b1cc6864493a2eadefcf112a1cb1edba517 100644 --- a/src/PHPCodeSniffer/Finder.php +++ b/src/PHPCodeSniffer/Finder.php @@ -21,6 +21,7 @@ namespace Higidi\ComposerPhpCSStandardsPlugin\PHPCodeSniffer; * 02110-1301, USA. */ +use Higidi\ComposerPhpCSStandardsPlugin\Symfony\Finder\Factory as FinderFactory; use Symfony\Component\Finder\Finder as SymfonyFinder; use Symfony\Component\Finder\SplFileInfo; @@ -29,6 +30,10 @@ use Symfony\Component\Finder\SplFileInfo; */ class Finder { + /** + * @var FinderFactory + */ + protected $finderFactory; /** * @var StandardsFactory @@ -36,10 +41,12 @@ class Finder protected $factory; /** + * @param FinderFactory|null $finderFactory * @param StandardsFactory|null $factory */ - public function __construct(StandardsFactory $factory = null) + public function __construct(FinderFactory $finderFactory = null, StandardsFactory $factory = null) { + $this->finderFactory = $finderFactory ?: new FinderFactory(); $this->factory = $factory ?: new StandardsFactory(); } @@ -73,7 +80,7 @@ class Finder */ protected function getSymfonyFinder() { - return SymfonyFinder::create(); + return $this->finderFactory->create(); } /**