Task/File/YamlReaderTask.php
protected function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired(
            [
                'file_path',
            ]
        );
        $resolver->setAllowedTypes('file_path', ['string']);
        $resolver->setNormalizer(
            'file_path',
            function (Options $options, $value) {
                if (!file_exists($value)) {
                    throw new \UnexpectedValueException("File not found: {$value}");
                }

                return $value;
            }
        );
    }
protected function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired(
            [
                'file_path',
            ]
        );
        $resolver->setAllowedTypes('file_path', ['string']);
        $resolver->setNormalizer(
            'file_path',
            function (Options $options, $value) {
                if (!file_exists($value)) {
                    throw new \UnexpectedValueException("File not found: {$value}");
                }

                return $value;
            }
        );
    }
@param OptionsResolver $resolver

@throws \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
@throws \Symfony\Component\OptionsResolver\Exception\AccessException
@throws \UnexpectedValueException