services:
    _defaults:
        public: true
        autowire: true

    Rector\:
        resource: '../src'
        exclude: '../src/{Node/Attribute.php,Rector/**/*Rector.php,Reporting/FileDiff.php,Testing/PHPUnit,RectorDefinition,PhpParser/Node/*Info.php,Exception/*,DependencyInjection/CompilerPass/*,DependencyInjection/Loader/*,Application/Error.php,HttpKernel/RectorKernel.php}'

    # extra services
    Rector\Symfony\Rector\Form\Helper\FormTypeStringToTypeProvider: ~

    Symfony\Component\Console\Application:
        alias: 'Rector\Console\Application'

    Symfony\Component\Console\Descriptor\TextDescriptor: ~

    # PhpParser - Parser
    PhpParser\ParserFactory: ~
    PhpParser\BuilderFactory: ~
    PhpParser\NodeVisitor\CloningVisitor:
    PhpParser\NodeFinder: ~

    # value resolver
    Symfony\Component\Filesystem\Filesystem: ~
    Symplify\PackageBuilder\Reflection\PrivatesAccessor: ~

    Symplify\PackageBuilder\FileSystem\FileSystem: ~
    Symplify\PackageBuilder\FileSystem\FinderSanitizer: ~

    Symplify\PackageBuilder\Parameter\ParameterProvider: ~
    Symplify\PackageBuilder\Reflection\PrivatesCaller: ~
    Symplify\PackageBuilder\Strings\StringFormatConverter: ~

    # see https://github.com/symplify/packagebuilder#prevent-parameter-typos
    Symplify\PackageBuilder\EventSubscriber\ParameterTypoProofreaderEventSubscriber: ~
    Symplify\PackageBuilder\Parameter\ParameterTypoProofreader:
        $correctToTypos:
            # keep "exclude_" explicit, to get typos to the correct key
            exclude_paths:
                - 'exclude_path'
                - 'excluded_path'
                - 'exclude_dir'
                - 'excluded_dir'
                - 'exclude_dirs'
                - 'excluded_dirs'
                - 'exclude_file'
                - 'excluded_file'
                - 'exclude_files'
                - 'excluded_files'
                - 'ignore_path'
                - 'ignored_path'
                - 'ignore_paths'
                - 'ignored_paths'
                - 'ignore_dir'
                - 'ignored_dir'
                - 'ignore_dirs'
                - 'ignored_dirs'
                - 'ignore_file'
                - 'ignored_file'
                - 'ignore_files'
                - 'ignored_files'
                - 'skip_path'
                - 'skip_paths'
                - 'skip_dir'
                - 'skip_dirs'
                - 'skip_file'
                - 'skip_files'
            exclude_rectors:
                - 'exclude_rector'
                - 'excluded_rector'
                - 'excluded_rectors'
                - 'skip_rector'
                - 'skip_rectors'
            autoload_paths:
                # https://regex101.com/r/aXEZYk/1
                - '#(autoload|include|bootstrap)((ed)?_(path(s)?|dir(s)?|file(s)?))?#'
