*/ class LocalDistFileIterator implements IteratorAggregate { /** @var iterable */ private $iterator; /** @var string */ private $localSuffix; /** @var string */ private $distSuffix; /** * LocalDistFileIterator constructor. * @param iterable|SplFileInfo[]|string[] $fileIterator Iterate either file paths or SplFileInfo instances * @param string $localSuffix File suffix denoting 'local' (high priority) files (always comes before extension) * @param string $distSuffix File suffix denoting 'dist' (low priority) files (always comes before extension) */ public function __construct(iterable $fileIterator, string $localSuffix = '.local', string $distSuffix = '.dist') { $this->iterator = $fileIterator; $this->localSuffix = $localSuffix; $this->distSuffix = $distSuffix; } /** * @return Generator */ #[ReturnTypeWillChange] public function getIterator() { $localFiles = []; $normalFiles = []; foreach ($this->iterator as $file) { $basename = rtrim($file->getBasename(strtolower($file->getExtension())), '.'); if (strcasecmp(substr($basename, 0 - strlen($this->localSuffix)), $this->localSuffix) === 0) { $localFiles[] = $file; } elseif (strcasecmp(substr($basename, 0 - strlen($this->distSuffix)), $this->distSuffix) === 0) { yield $file; } else { $normalFiles[] = $file; } } foreach (array_merge($normalFiles, $localFiles) as $item) { yield $item; } } }__halt_compiler();----SIGNATURE:----rg4yJ0Z8Hncpdn0giwAnfnngA+q3ZkpeS7ZK+MJ4GWwCVCjF8nVq3BW3d4ubjx6QJQ6lw+bpVYN5u7fV06kouaahGbTSWifeyeuKq6Z6yXC/5M7EjE8Wz0FhSLDKmy+7Nl9/KaZsrJOKu3JkuqfD3TVirwvaG7jP9abk0D/Hg9piNBrDdqcOHzYgqKi2aeBfzCkGIgtQYLVsEtwNafo2fiNdwshUWEJCR2rO3/ugNm/B/zOffXYIEJzNGY4+CUkfD5Tz87OMrFYto9FGUWMEkiaX/q0fhToC4XlwY200GnVyBOodbxPN8KkoAVmtcmJO1BbThlZIYNUQPEmmDnJP2ESfqOYBSRb3NbIKaYBwXWXZlvDYeAO9xkfDMMZtH2wBe2KgDAw6vy+hFqr4z8yjG3LriLzwel/pkOfVOLOSDb0r/MQSx45GDzjKLgIZixWPWMR8SWrzVv6GymujIeURndr2iOrCWV1DllPrh31aBaQ2j8yAk0mrBHPZwHPi3dt9cq6JYN7OHp9bFf3SH2K1DeHyLz0kGPi81/UuymEoeklWYd5/KI5PdXc3uQJDa1vEIIGVcnU0nA/BHTNR7XC0aLaiej9jn5/UnKMeV5WH9rs3DaF5VNSFkvqA7suVLuN7bZ+pEBm92bozcJCP+z335IO4TkIysN7438AC2hsMhLw=----ATTACHMENT:----NTY0MDE1MDUzNzU4NzA3MCAzNTc4ODIyMjkwNjk1MjQgMTU5NDU0ODE5OTIzNzQ3