src/Fixer/Operator/BinaryOperatorSpacesFixer.php
protected function createConfigurationDefinition()
    {
        return new FixerConfigurationResolver([
            (new FixerOptionBuilder('default', 'Default fix strategy.'))
                ->setDefault(self::SINGLE_SPACE)
                ->setAllowedValues(self::$allowedValues)
                ->getOption(),
            (new FixerOptionBuilder('operators', 'Dictionary of `binary operator` => `fix strategy` values that differ from the default strategy.'))
                ->setAllowedTypes(['array'])
                ->setAllowedValues([static function ($option) {
                    foreach ($option as $operator => $value) {
                        if (!\in_array($operator, self::$supportedOperators, true)) {
                            throw new InvalidOptionsException(
                                sprintf(
                                    'Unexpected "operators" key, expected any of "%s", got "%s".',
                                    implode('", "', self::$supportedOperators),
                                    \is_object($operator) ? \get_class($operator) : \gettype($operator).'#'.$operator
                                )
                            );
                        }

                        if (!\in_array($value, self::$allowedValues, true)) {
                            throw new InvalidOptionsException(
                                sprintf(
                                    'Unexpected value for operator "%s", expected any of "%s", got "%s".',
                                    $operator,
                                    implode('", "', self::$allowedValues),
                                    \is_object($value) ? \get_class($value) : (null === $value ? 'null' : \gettype($value).'#'.$value)
                                )
                            );
                        }
                    }

                    return true;
                }])
                ->setDefault([])
                ->getOption(),
            // add deprecated options as BC layer
            (new FixerOptionBuilder('align_double_arrow', 'Whether to apply, remove or ignore double arrows alignment.'))
                ->setDefault(false)
                ->setAllowedValues([true, false, null])
                ->setDeprecationMessage('Use options `operators` and `default` instead.')
                ->getOption(),
            (new FixerOptionBuilder('align_equals', 'Whether to apply, remove or ignore equals alignment.'))
                ->setDefault(false)
                ->setAllowedValues([true, false, null])
                ->setDeprecationMessage('Use options `operators` and `default` instead.')
                ->getOption(),
        ]);
    }
protected function createConfigurationDefinition()
    {
        return new FixerConfigurationResolver([
            (new FixerOptionBuilder('default', 'Default fix strategy.'))
                ->setDefault(self::SINGLE_SPACE)
                ->setAllowedValues(self::$allowedValues)
                ->getOption(),
            (new FixerOptionBuilder('operators', 'Dictionary of `binary operator` => `fix strategy` values that differ from the default strategy.'))
                ->setAllowedTypes(['array'])
                ->setAllowedValues([static function ($option) {
                    foreach ($option as $operator => $value) {
                        if (!\in_array($operator, self::$supportedOperators, true)) {
                            throw new InvalidOptionsException(
                                sprintf(
                                    'Unexpected "operators" key, expected any of "%s", got "%s".',
                                    implode('", "', self::$supportedOperators),
                                    \is_object($operator) ? \get_class($operator) : \gettype($operator).'#'.$operator
                                )
                            );
                        }

                        if (!\in_array($value, self::$allowedValues, true)) {
                            throw new InvalidOptionsException(
                                sprintf(
                                    'Unexpected value for operator "%s", expected any of "%s", got "%s".',
                                    $operator,
                                    implode('", "', self::$allowedValues),
                                    \is_object($value) ? \get_class($value) : (null === $value ? 'null' : \gettype($value).'#'.$value)
                                )
                            );
                        }
                    }

                    return true;
                }])
                ->setDefault([])
                ->getOption(),
            // add deprecated options as BC layer
            (new FixerOptionBuilder('align_double_arrow', 'Whether to apply, remove or ignore double arrows alignment.'))
                ->setDefault(false)
                ->setAllowedValues([true, false, null])
                ->setDeprecationMessage('Use options `operators` and `default` instead.')
                ->getOption(),
            (new FixerOptionBuilder('align_equals', 'Whether to apply, remove or ignore equals alignment.'))
                ->setDefault(false)
                ->setAllowedValues([true, false, null])
                ->setDeprecationMessage('Use options `operators` and `default` instead.')
                ->getOption(),
        ]);
    }
protected function createConfigurationDefinition ( ) { return new FixerConfigurationResolver ( [ ( new FixerOptionBuilder ( 'default' , 'Default fix strategy.' ) ) -> setDefault ( self :: SINGLE_SPACE ) -> setAllowedValues ( self :: $ allowedValues ) -> getOption ( ) , ( new FixerOptionBuilder ( 'operators' , 'Dictionary of `binary operator` => `fix strategy` values that differ from the default strategy.' ) ) -> setAllowedTypes ( [ 'array' ] ) -> setAllowedValues ( [ static function ( $ option ) { foreach ( $ option as $ operator => $ value ) { if ( ! \ in_array ( $ operator , self :: $ supportedOperators , true ) ) { throw new InvalidOptionsException ( sprintf ( 'Unexpected "operators" key, expected any of "%s", got "%s".' , implode ( '", "' , self :: $ supportedOperators ) , \ is_object ( $ operator ) ? \ get_class ( $ operator ) : \ gettype ( $ operator ) . '#' . $ operator ) ) ; } if ( ! \ in_array ( $ value , self :: $ allowedValues , true ) ) { throw new InvalidOptionsException ( sprintf ( 'Unexpected value for operator "%s", expected any of "%s", got "%s".' , $ operator , implode ( '", "' , self :: $ allowedValues ) , \ is_object ( $ value ) ? \ get_class ( $ value ) : ( null === $ value ? 'null' : \ gettype ( $ value ) . '#' . $ value ) ) ) ; } } return true ; } ] ) -> setDefault ( [ ] ) -> getOption ( ) , // add deprecated options as BC layer ( new FixerOptionBuilder ( 'align_double_arrow' , 'Whether to apply, remove or ignore double arrows alignment.' ) ) -> setDefault ( false ) -> setAllowedValues ( [ true , false , null ] ) -> setDeprecationMessage ( 'Use options `operators` and `default` instead.' ) -> getOption ( ) , ( new FixerOptionBuilder ( 'align_equals' , 'Whether to apply, remove or ignore equals alignment.' ) ) -> setDefault ( false ) -> setAllowedValues ( [ true , false , null ] ) -> setDeprecationMessage ( 'Use options `operators` and `default` instead.' ) -> getOption ( ) , ] ) ; }
{@inheritdoc}
{