src/Fixer/Operator/BinaryOperatorSpacesFixer.php
private function resolveOldConfig(array $configuration)
    {
        $newConfig = [
            'operators' => [],
        ];

        foreach ($configuration as $name => $setting) {
            if ('align_double_arrow' === $name) {
                if (true === $configuration[$name]) {
                    $newConfig['operators']['=>'] = self::ALIGN;
                } elseif (false === $configuration[$name]) {
                    $newConfig['operators']['=>'] = self::SINGLE_SPACE;
                } elseif (null !== $configuration[$name]) {
                    throw new InvalidFixerConfigurationException(
                        $this->getName(),
                        sprintf(
                            'Invalid configuration: The option "align_double_arrow" with value %s is invalid. Accepted values are: true, false, null.',
                            $configuration[$name]
                        )
                    );
                }
            } elseif ('align_equals' === $name) {
                if (true === $configuration[$name]) {
                    $newConfig['operators']['='] = self::ALIGN;
                } elseif (false === $configuration[$name]) {
                    $newConfig['operators']['='] = self::SINGLE_SPACE;
                } elseif (null !== $configuration[$name]) {
                    throw new InvalidFixerConfigurationException(
                        $this->getName(),
                        sprintf(
                            'Invalid configuration: The option "align_equals" with value %s is invalid. Accepted values are: true, false, null.',
                            $configuration[$name]
                        )
                    );
                }
            } else {
                throw new InvalidFixerConfigurationException($this->getName(), 'Mixing old configuration with new configuration is not allowed.');
            }
        }

        $message = sprintf(
            'Given configuration is deprecated and will be removed in 3.0. Use configuration %s as replacement for %s.',
            HelpCommand::toString($newConfig),
            HelpCommand::toString($configuration)
        );

        if (getenv('PHP_CS_FIXER_FUTURE_MODE')) {
            throw new InvalidFixerConfigurationException($this->getName(), "{$message} This check was performed as `PHP_CS_FIXER_FUTURE_MODE` env var is set.");
        }

        @trigger_error($message, E_USER_DEPRECATED);

        return $newConfig;
    }
private function resolveOldConfig(array $configuration)
    {
        $newConfig = [
            'operators' => [],
        ];

        foreach ($configuration as $name => $setting) {
            if ('align_double_arrow' === $name) {
                if (true === $configuration[$name]) {
                    $newConfig['operators']['=>'] = self::ALIGN;
                } elseif (false === $configuration[$name]) {
                    $newConfig['operators']['=>'] = self::SINGLE_SPACE;
                } elseif (null !== $configuration[$name]) {
                    throw new InvalidFixerConfigurationException(
                        $this->getName(),
                        sprintf(
                            'Invalid configuration: The option "align_double_arrow" with value %s is invalid. Accepted values are: true, false, null.',
                            $configuration[$name]
                        )
                    );
                }
            } elseif ('align_equals' === $name) {
                if (true === $configuration[$name]) {
                    $newConfig['operators']['='] = self::ALIGN;
                } elseif (false === $configuration[$name]) {
                    $newConfig['operators']['='] = self::SINGLE_SPACE;
                } elseif (null !== $configuration[$name]) {
                    throw new InvalidFixerConfigurationException(
                        $this->getName(),
                        sprintf(
                            'Invalid configuration: The option "align_equals" with value %s is invalid. Accepted values are: true, false, null.',
                            $configuration[$name]
                        )
                    );
                }
            } else {
                throw new InvalidFixerConfigurationException($this->getName(), 'Mixing old configuration with new configuration is not allowed.');
            }
        }

        $message = sprintf(
            'Given configuration is deprecated and will be removed in 3.0. Use configuration %s as replacement for %s.',
            HelpCommand::toString($newConfig),
            HelpCommand::toString($configuration)
        );

        if (getenv('PHP_CS_FIXER_FUTURE_MODE')) {
            throw new InvalidFixerConfigurationException($this->getName(), "{$message} This check was performed as `PHP_CS_FIXER_FUTURE_MODE` env var is set.");
        }

        @trigger_error($message, E_USER_DEPRECATED);

        return $newConfig;
    }
private function resolveOldConfig ( array $ configuration ) { $ newConfig = [ 'operators' => [ ] , ] ; foreach ( $ configuration as $ name => $ setting ) { if ( 'align_double_arrow' === $ name ) { if ( true === $ configuration [ $ name ] ) { $ newConfig [ 'operators' ] [ '=>' ] = self :: ALIGN ; } elseif ( false === $ configuration [ $ name ] ) { $ newConfig [ 'operators' ] [ '=>' ] = self :: SINGLE_SPACE ; } elseif ( null !== $ configuration [ $ name ] ) { throw new InvalidFixerConfigurationException ( $ this -> getName ( ) , sprintf ( 'Invalid configuration: The option "align_double_arrow" with value %s is invalid. Accepted values are: true, false, null.' , $ configuration [ $ name ] ) ) ; } } elseif ( 'align_equals' === $ name ) { if ( true === $ configuration [ $ name ] ) { $ newConfig [ 'operators' ] [ '=' ] = self :: ALIGN ; } elseif ( false === $ configuration [ $ name ] ) { $ newConfig [ 'operators' ] [ '=' ] = self :: SINGLE_SPACE ; } elseif ( null !== $ configuration [ $ name ] ) { throw new InvalidFixerConfigurationException ( $ this -> getName ( ) , sprintf ( 'Invalid configuration: The option "align_equals" with value %s is invalid. Accepted values are: true, false, null.' , $ configuration [ $ name ] ) ) ; } } else { throw new InvalidFixerConfigurationException ( $ this -> getName ( ) , 'Mixing old configuration with new configuration is not allowed.' ) ; } } $ message = sprintf ( 'Given configuration is deprecated and will be removed in 3.0. Use configuration %s as replacement for %s.' , HelpCommand :: toString ( $ newConfig ) , HelpCommand :: toString ( $ configuration ) ) ; if ( getenv ( 'PHP_CS_FIXER_FUTURE_MODE' ) ) { throw new InvalidFixerConfigurationException ( $ this -> getName ( ) , "{$message} This check was performed as `PHP_CS_FIXER_FUTURE_MODE` env var is set." ) ; } @ trigger_error ( $ message , E_USER_DEPRECATED ) ; return $ newConfig ; }
@param array $configuration

@return array
@param array $configuration