Conditions | 10 |
Paths | 2 |
Total Lines | 45 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
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:
If many parameters/temporary variables are present:
1 | <?php |
||
103 | |||
104 | foreach ($pattern as $key=>$value){ |
||
105 | if(($this->route->isMatchVaribleRegexPattern($value)===false) || ($this->route->isMatchVaribleRegexPattern($value) |
||
106 | && !$this->route->isOptionalVaribleRegexPattern($value))){ |
||
107 | $list['default'][$key] = $value; |
||
108 | } |
||
109 | |||
110 | if(($this->route->isMatchVaribleRegexPattern($value) |
||
111 | && $this->route->isOptionalVaribleRegexPattern($value))){ |
||
112 | $list['optional'][] = true; |
||
113 | } |
||
114 | } |
||
115 | |||
116 | return $list; |
||
117 | } |
||
118 | |||
119 | /** |
||
120 | * show key according tp scored list |
||
121 | * |
||
122 | * @param array $scoredList |
||
123 | * @return false|int|string |
||
124 | */ |
||
125 | private function showKeyAccordingToScoredList($scoredList=array()) |
||
126 | { |
||
127 | $scored = []; |
||
128 | |||
129 | foreach($scoredList as $key=>$item){ |
||
130 | $scored[$key] = array_sum($item); |
||
131 | } |
||
132 | |||
133 | if(count($scored)){ |
||
134 | return array_search(max($scored),$scored); |
||
135 | } |
||
136 | |||
137 | return null; |
||
138 | |||
139 | } |
||
140 | |||
141 | /** |
||
142 | * is same on static strings |
||
143 | * |
||
144 | * @param $pattern |
||
145 | * @return bool |
||
146 | */ |
||
147 | private function isSameOnStaticStrings($pattern) |
||
148 | { |
||
161 | } |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.