Completed
Pull Request — master (#223)
by Jaap
07:24
created

Parser::initReduceCallbacks()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 55

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 55
rs 8.9818
c 0
b 0
f 0
cc 1
nc 1
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * This file is part of phpDocumentor.
4
 *
5
 *  For the full copyright and license information, please view the LICENSE
6
 *  file that was distributed with this source code.
7
 *
8
 *  @link      http://phpdoc.org
9
 *
10
 */
11
12
13
namespace phpDocumentor\Reflection;
14
15
16
/* This is an automatically GENERATED file, which should not be manually edited.
17
 */
18
class Parser extends BaseParser
19
{
20
    protected $tokenToSymbolMapSize = 266;
21
    protected $actionTableSize      = 23;
22
    protected $gotoTableSize        = 4;
23
24
    protected $invalidSymbol       = 11;
25
    protected $errorSymbol         = 1;
26
    protected $defaultAction       = -32766;
27
    protected $unexpectedTokenRule = 32767;
28
29
    protected $numNonLeafStates    = 15;
30
31
    protected $YY2TBLSTATE = 8;
32
    protected $YYNLSTATES  = 15;
33
34
    protected $symbolToName = array(
35
        "EOF",
36
        "error",
37
        "T_START",
38
        "T_END",
39
        "T_LINE_START",
40
        "T_AT",
41
        "T_COLON",
42
        "T_STRING",
43
        "T_CHAR",
44
        "T_CRLF",
45
        "T_WHITESPACE"
46
    );
47
48
    protected $tokenToSymbol = array(
49
            0,   11,   11,   11,   11,   11,   11,   11,   11,   11,
50
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
51
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
52
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
53
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
54
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
55
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
56
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
57
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
58
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
59
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
60
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
61
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
62
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
63
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
64
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
65
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
66
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
67
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
68
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
69
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
70
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
71
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
72
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
73
           11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
74
           11,   11,   11,   11,   11,   11,    1,    2,    3,    4,
75
            5,    6,    7,    8,    9,   10
76
    );
77
78
    protected $action = array(
79
           24,   25,   26,    0,   27,   16,    1,    8,   12,   17,
80
           18,    0,    0,   11,    0,   14,    0,   13,   22,    0,
81
            0,   29,   30
82
    );
83
84
    protected $actionCheck = array(
85
            6,    7,    8,    0,   10,    3,    4,    2,    4,    3,
86
            3,   -1,   -1,    5,   -1,    6,   -1,    7,    7,   -1,
87
           -1,    9,    9
88
    );
89
90
    protected $actionBase = array(
91
            5,    8,   -6,   -6,    2,    4,    6,    7,   12,   12,
92
            3,   10,    8,    9,   11,    0,   -6,    0,    0,   13,
93
           12,   13,   13
94
    );
95
96
    protected $actionDefault = array(
97
        32767,32767,    8,   13,32767,   16,32767,32767,   16,   16,
98
        32767,32767,32767,    6,32767
99
    );
100
101
    protected $goto = array(
102
            4,    6,    2,   20
103
    );
104
105
    protected $gotoCheck = array(
106
            2,    2,    6,    5
107
    );
108
109
    protected $gotoBase = array(
110
            0,    0,   -8,    0,    0,   -2,    1
111
    );
112
113
    protected $gotoDefault = array(
114
        -32768,   10,    7,    9,    5,   19,    3
115
    );
116
117
    protected $ruleToNonTerminal = array(
118
            0,    1,    1,    1,    4,    4,    5,    5,    3,    6,
119
            6,    6,    6,    6,    2,    2,    2
120
    );
121
122
    protected $ruleToLength = array(
123
            1,    3,    5,    5,    1,    2,    3,    5,    2,    1,
124
            1,    1,    1,    2,    1,    2,    0
125
    );
126
127
    protected function initReduceCallbacks() {
128
        $this->reduceCallbacks = [
129
            0 => function ($stackPos) {
130
            $this->semValue = $this->semStack[$stackPos];
131
        },
132
            1 => function ($stackPos) {
0 ignored issues
show
Unused Code introduced by
The parameter $stackPos is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
133
             $this->semValue = new AST\Docblock(); 
0 ignored issues
show
Documentation Bug introduced by
It seems like new \phpDocumentor\Reflection\AST\Docblock() of type object<phpDocumentor\Reflection\AST\Docblock> is incompatible with the declared type object<phpDocumentor\Ref...\Reflection\Type>>|null of property $semValue.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
134
            },
135
            2 => function ($stackPos) {
136
             $this->semValue = new AST\Docblock($this->semStack[$stackPos-(5-3)]); 
0 ignored issues
show
Documentation Bug introduced by
It seems like new \phpDocumentor\Refle...k[$stackPos - (5 - 3)]) of type object<phpDocumentor\Reflection\AST\Docblock> is incompatible with the declared type object<phpDocumentor\Ref...\Reflection\Type>>|null of property $semValue.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
137
            },
138
            3 => function ($stackPos) {
139
             $this->semValue = new AST\Docblock(null, ...$this->semStack[$stackPos-(5-3)]); 
0 ignored issues
show
Documentation Bug introduced by
It seems like new \phpDocumentor\Refle...k[$stackPos - (5 - 3)]) of type object<phpDocumentor\Reflection\AST\Docblock> is incompatible with the declared type object<phpDocumentor\Ref...\Reflection\Type>>|null of property $semValue.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
140
            },
141
            4 => function ($stackPos) {
142
             $this->semValue = [$this->semStack[$stackPos-(1-1)]]; 
143
            },
144
            5 => function ($stackPos) {
145
             $tags = $this->semStack[$stackPos-(2-1)]; $tags[] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $tags; 
146
            },
147
            6 => function ($stackPos) {
148
             $this->semValue = new AST\Tag($this->semStack[$stackPos-(3-3)]); 
0 ignored issues
show
Documentation Bug introduced by
It seems like new \phpDocumentor\Refle...k[$stackPos - (3 - 3)]) of type object<phpDocumentor\Reflection\AST\Tag> is incompatible with the declared type object<phpDocumentor\Ref...\Reflection\Type>>|null of property $semValue.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
149
            },
150
            7 => function ($stackPos) {
151
             $this->semValue = new AST\Tag($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)]); 
0 ignored issues
show
Documentation Bug introduced by
It seems like new \phpDocumentor\Refle...k[$stackPos - (5 - 5)]) of type object<phpDocumentor\Reflection\AST\Tag> is incompatible with the declared type object<phpDocumentor\Ref...\Reflection\Type>>|null of property $semValue.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
152
            },
153
            8 => function ($stackPos) {
154
             $this->semValue = $this->semStack[$stackPos-(2-2)]; 
155
            },
156
            9 => function ($stackPos) {
157
            $this->semValue = $this->semStack[$stackPos];
158
        },
159
            10 => function ($stackPos) {
160
            $this->semValue = $this->semStack[$stackPos];
161
        },
162
            11 => function ($stackPos) {
163
            $this->semValue = $this->semStack[$stackPos];
164
        },
165
            12 => function ($stackPos) {
166
            $this->semValue = $this->semStack[$stackPos];
167
        },
168
            13 => function ($stackPos) {
169
             $this->semValue = $this->semStack[$stackPos-(2-1)] . $this->semStack[$stackPos-(2-2)]; 
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->semStack[$stackPo...ck[$stackPos - (2 - 2)] of type string is incompatible with the declared type object<phpDocumentor\Ref...\Reflection\Type>>|null of property $semValue.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
170
            },
171
            14 => function ($stackPos) {
172
            $this->semValue = $this->semStack[$stackPos];
173
        },
174
            15 => function ($stackPos) {
175
            $this->semValue = $this->semStack[$stackPos];
176
        },
177
            16 => function ($stackPos) {
178
            $this->semValue = $this->semStack[$stackPos];
179
        },
180
        ];
181
    }
182
}
183