src/Helper/DirectoryIterator.php
public function files(?int $constraints = null): \Generator
    {
        foreach ($this->all($constraints) as $file) {
            if (!$file->isDir()) {
                yield $file;
            }
        }
    }
public function files(?int $constraints = null): \Generator
    {
        foreach ($this->all($constraints) as $file) {
            if (!$file->isDir()) {
                yield $file;
            }
        }
    }
list only files
@param int|null $constraints
@return File[]