protected function searchFiles(array $directories, $filter = null)
    {
        $finder = new Finder();
        $finder->files()
            ->name('*.php')
            ->in($directories)
            ->depth($this->depth);

        if (isset($filter) && is_callable($filter)) {
            $finder->filter($filter);
        }

        return $finder;
    }