Task/File/YamlReaderTask.php
protected function initializeIterator(ProcessState $state): \Iterator
    {
        $filePath = $this->getOption($state, 'file_path');
        $content = Yaml::parseFile($filePath);
        if (!\is_array($content)) {
            throw new \InvalidArgumentException("File content is not an array: {$filePath}");
        }

        return new \ArrayIterator($content);
    }
protected function initializeIterator(ProcessState $state): \Iterator
    {
        $filePath = $this->getOption($state, 'file_path');
        $content = Yaml::parseFile($filePath);
        if (!\is_array($content)) {
            throw new \InvalidArgumentException("File content is not an array: {$filePath}");
        }

        return new \ArrayIterator($content);
    }
@param ProcessState $state

@throws \InvalidArgumentException
@throws \Symfony\Component\Yaml\Exception\ParseException
@throws \Symfony\Component\OptionsResolver\Exception\ExceptionInterface

@return \Iterator