src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php
private function getWrapperMethodSequence(Tokens $tokens, $method, $startIndex, $bodyIndex)
    {
        // initialise sequence as { $this->{$method}(
        $seq = [
            '{',
            [T_VARIABLE, '$this'],
            [T_OBJECT_OPERATOR],
            [T_STRING, $method],
            '(',
        ];
        $case = [3 => false];

        // parse method parameters, if any
        $index = $startIndex;
        while (true) {
            // find the next variable name
            $index = $tokens->getNextTokenOfKind($index, [[T_VARIABLE]]);

            if (null === $index || $index >= $bodyIndex) {
                // we've reached the body already
                break;
            }

            // append a comma if it's not the first variable
            if (\count($seq) > 5) {
                $seq[] = ',';
            }

            // append variable name to the sequence
            $seq[] = [T_VARIABLE, $tokens[$index]->getContent()];
        }

        // almost done, close the sequence with ); }
        $seq[] = ')';
        $seq[] = ';';
        $seq[] = '}';

        return [$seq, $case];
    }
private function getWrapperMethodSequence(Tokens $tokens, $method, $startIndex, $bodyIndex)
    {
        // initialise sequence as { $this->{$method}(
        $seq = [
            '{',
            [T_VARIABLE, '$this'],
            [T_OBJECT_OPERATOR],
            [T_STRING, $method],
            '(',
        ];
        $case = [3 => false];

        // parse method parameters, if any
        $index = $startIndex;
        while (true) {
            // find the next variable name
            $index = $tokens->getNextTokenOfKind($index, [[T_VARIABLE]]);

            if (null === $index || $index >= $bodyIndex) {
                // we've reached the body already
                break;
            }

            // append a comma if it's not the first variable
            if (\count($seq) > 5) {
                $seq[] = ',';
            }

            // append variable name to the sequence
            $seq[] = [T_VARIABLE, $tokens[$index]->getContent()];
        }

        // almost done, close the sequence with ); }
        $seq[] = ')';
        $seq[] = ';';
        $seq[] = '}';

        return [$seq, $case];
    }
private function getWrapperMethodSequence ( Tokens $ tokens , $ method , $ startIndex , $ bodyIndex ) { // initialise sequence as { $this->{$method}( $ seq = [ '{' , [ T_VARIABLE , '$this' ] , [ T_OBJECT_OPERATOR ] , [ T_STRING , $ method ] , '(' , ] ; $ case = [ 3 => false ] ; // parse method parameters, if any $ index = $ startIndex ; while ( true ) { // find the next variable name $ index = $ tokens -> getNextTokenOfKind ( $ index , [ [ T_VARIABLE ] ] ) ; if ( null === $ index || $ index >= $ bodyIndex ) { // we've reached the body already break ; } // append a comma if it's not the first variable if ( \ count ( $ seq ) > 5 ) { $ seq [ ] = ',' ; } // append variable name to the sequence $ seq [ ] = [ T_VARIABLE , $ tokens [ $ index ] -> getContent ( ) ] ; } // almost done, close the sequence with ); } $ seq [ ] = ')' ; $ seq [ ] = ';' ; $ seq [ ] = '}' ; return [ $ seq , $ case ] ; }
Generate the sequence of tokens necessary for the body of a wrapper method that simply
calls $this->{$method}( [args...] ) with the same arguments as its own signature.

@param Tokens $tokens     the Tokens instance
@param string $method     the wrapped method name
@param int    $startIndex function/method start index
@param int    $bodyIndex  function/method body index

@return array an array containing the sequence and case sensitiveness [ 0 => $seq, 1 => $case ]
Generate the sequence of tokens necessary for the body of a wrapper method that simply calls $this - > { $method } ( [ args ... ] ) with the same arguments as its own signature .