*/ 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|SplFileInfo[] */ 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:----jzBA0TjUgmVFESSUN/VQMWAgslWOt+lCxHIG+g/qUzvYcH+WhGSIP1f4Ppq1UGTZy1L81YrmfxI6P7JTVVih3TKBGZd4O+dYITnNUIJ8eLgesx+kqBGbcMb+9BSIYyl0ETJyPJ8IHjf7mFBLbHgxVg5ERBAs99kgzOLpcktNY/Y1WAJ6PoapWAwu9NPooqaO/sx/bUo9vFhYEFoQfvWgQyvcn1E8tBg9wHP3lMENSjTima7SNLhNJrwxtte+SHD5AdbCRAB9TeFqiY4P0kDor8QYo8b7rPgf/2OiJ9Fm7wxo7a6Dr7E9SEuL8lFgntZ8FsCmx71mrN0rYVk2YqP7H2MX5vFxC1L9WztGIsZIUTrvOULgmJvUUZDl8kHETGwdjqQtgAiKJ10k4xTPE8RonlA0qd+UcDDoOnwWLKa9SbbFkS5cGwb7W+MBUnDVoHhs2Oau7wtZAAbRubSDuTfbFOaZRtqhwapewsQ13tl0LqJSu2lrqUPLZ62eUWg0bR+rYdI+f1I14MOz+XLfE1r9MPVonJzxzlEmrxRH25g2FIn6aISLi+QL462woUw7KznCNAah0zYni1uYa7Le2Mao2aqtmXRjMhxwQHx4qJOdf6Ts5Kmpz3NrfTZmPOQQq3IH5n/SdJrP5lof2rLtwatOv3U0aW2OjcMBe+PnkEAzThA=----ATTACHMENT:----NjU2OTY4NDQ3NDcxOTg3MSA3MTg3MTUxMjUyMjE4MzMwIDM5OTYyOTk1Njk5MTQ1NTg=