src/Fixer/Whitespace/NoExtraBlankLinesFixer.php
public function configure(array $configuration = null)
    {
        parent::configure($configuration);

        static $reprToTokenMap = [
            'break' => T_BREAK,
            'case' => T_CASE,
            'continue' => T_CONTINUE,
            'curly_brace_block' => '{',
            'default' => T_DEFAULT,
            'extra' => T_WHITESPACE,
            'parenthesis_brace_block' => '(',
            'return' => T_RETURN,
            'square_brace_block' => CT::T_ARRAY_SQUARE_BRACE_OPEN,
            'switch' => T_SWITCH,
            'throw' => T_THROW,
            'use' => T_USE,
            'use_trait' => CT::T_USE_TRAIT,
        ];

        static $tokenKindCallbackMap = [
            T_BREAK => 'fixAfterToken',
            T_CASE => 'fixAfterToken',
            T_CONTINUE => 'fixAfterToken',
            T_DEFAULT => 'fixAfterToken',
            T_RETURN => 'fixAfterToken',
            T_SWITCH => 'fixAfterToken',
            T_THROW => 'fixAfterToken',
            T_USE => 'removeBetweenUse',
            T_WHITESPACE => 'removeMultipleBlankLines',
            CT::T_USE_TRAIT => 'removeBetweenUse',
            CT::T_ARRAY_SQUARE_BRACE_OPEN => 'fixStructureOpenCloseIfMultiLine', // typeless '[' tokens should not be fixed (too rare)
        ];

        static $tokenEqualsMap = [
            '{' => 'fixStructureOpenCloseIfMultiLine', // i.e. not: CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN
            '(' => 'fixStructureOpenCloseIfMultiLine', // i.e. not: CT::T_BRACE_CLASS_INSTANTIATION_OPEN
        ];

        $tokensAssoc = array_flip(array_intersect_key($reprToTokenMap, array_flip($this->configuration['tokens'])));

        $this->tokenKindCallbackMap = array_intersect_key($tokenKindCallbackMap, $tokensAssoc);
        $this->tokenEqualsMap = array_intersect_key($tokenEqualsMap, $tokensAssoc);
    }
public function configure(array $configuration = null)
    {
        parent::configure($configuration);

        static $reprToTokenMap = [
            'break' => T_BREAK,
            'case' => T_CASE,
            'continue' => T_CONTINUE,
            'curly_brace_block' => '{',
            'default' => T_DEFAULT,
            'extra' => T_WHITESPACE,
            'parenthesis_brace_block' => '(',
            'return' => T_RETURN,
            'square_brace_block' => CT::T_ARRAY_SQUARE_BRACE_OPEN,
            'switch' => T_SWITCH,
            'throw' => T_THROW,
            'use' => T_USE,
            'use_trait' => CT::T_USE_TRAIT,
        ];

        static $tokenKindCallbackMap = [
            T_BREAK => 'fixAfterToken',
            T_CASE => 'fixAfterToken',
            T_CONTINUE => 'fixAfterToken',
            T_DEFAULT => 'fixAfterToken',
            T_RETURN => 'fixAfterToken',
            T_SWITCH => 'fixAfterToken',
            T_THROW => 'fixAfterToken',
            T_USE => 'removeBetweenUse',
            T_WHITESPACE => 'removeMultipleBlankLines',
            CT::T_USE_TRAIT => 'removeBetweenUse',
            CT::T_ARRAY_SQUARE_BRACE_OPEN => 'fixStructureOpenCloseIfMultiLine', // typeless '[' tokens should not be fixed (too rare)
        ];

        static $tokenEqualsMap = [
            '{' => 'fixStructureOpenCloseIfMultiLine', // i.e. not: CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN
            '(' => 'fixStructureOpenCloseIfMultiLine', // i.e. not: CT::T_BRACE_CLASS_INSTANTIATION_OPEN
        ];

        $tokensAssoc = array_flip(array_intersect_key($reprToTokenMap, array_flip($this->configuration['tokens'])));

        $this->tokenKindCallbackMap = array_intersect_key($tokenKindCallbackMap, $tokensAssoc);
        $this->tokenEqualsMap = array_intersect_key($tokenEqualsMap, $tokensAssoc);
    }
public function configure ( array $ configuration = null ) { parent :: configure ( $ configuration ) ; static $ reprToTokenMap = [ 'break' => T_BREAK , 'case' => T_CASE , 'continue' => T_CONTINUE , 'curly_brace_block' => '{' , 'default' => T_DEFAULT , 'extra' => T_WHITESPACE , 'parenthesis_brace_block' => '(' , 'return' => T_RETURN , 'square_brace_block' => CT :: T_ARRAY_SQUARE_BRACE_OPEN , 'switch' => T_SWITCH , 'throw' => T_THROW , 'use' => T_USE , 'use_trait' => CT :: T_USE_TRAIT , ] ; static $ tokenKindCallbackMap = [ T_BREAK => 'fixAfterToken' , T_CASE => 'fixAfterToken' , T_CONTINUE => 'fixAfterToken' , T_DEFAULT => 'fixAfterToken' , T_RETURN => 'fixAfterToken' , T_SWITCH => 'fixAfterToken' , T_THROW => 'fixAfterToken' , T_USE => 'removeBetweenUse' , T_WHITESPACE => 'removeMultipleBlankLines' , CT :: T_USE_TRAIT => 'removeBetweenUse' , CT :: T_ARRAY_SQUARE_BRACE_OPEN => 'fixStructureOpenCloseIfMultiLine' , // typeless '[' tokens should not be fixed (too rare) ] ; static $ tokenEqualsMap = [ '{' => 'fixStructureOpenCloseIfMultiLine' , // i.e. not: CT::T_ARRAY_INDEX_CURLY_BRACE_OPEN '(' => 'fixStructureOpenCloseIfMultiLine' , // i.e. not: CT::T_BRACE_CLASS_INSTANTIATION_OPEN ] ; $ tokensAssoc = array_flip ( array_intersect_key ( $ reprToTokenMap , array_flip ( $ this -> configuration [ 'tokens' ] ) ) ) ; $ this -> tokenKindCallbackMap = array_intersect_key ( $ tokenKindCallbackMap , $ tokensAssoc ) ; $ this -> tokenEqualsMap = array_intersect_key ( $ tokenEqualsMap , $ tokensAssoc ) ; }
{@inheritdoc}
{