public function enumerate(): Iterator
    {
        $finder = new Finder();
        $finder->files()
            ->name('*.php')
            ->in($this->getInPaths());

        foreach ($this->getExcludePaths() as $path) {
            $finder->notPath($path);
        }

        $iterator = $finder->getIterator();

        // on Windows platform the default iterator is unable to rewind, not sure why
        if (strpos(PHP_OS, 'WIN') === 0) {
            $iterator = new ArrayIterator(iterator_to_array($iterator));
        }

        return $iterator;
    }