Conditions | 28 |
Paths | 28 |
Total Lines | 34 |
Code Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Tests | 29 |
CRAP Score | 28.0289 |
Changes | 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 |
||
188 | 81 | public function getPartialRegex($const) |
|
189 | { |
||
190 | 81 | @trigger_error('RegexHelper no longer supports the getPartialRegex() function. Directly grab the PARTIAL_ constant you need instead.', E_USER_DEPRECATED); |
|
191 | |||
192 | switch ($const) { |
||
193 | 81 | case self::ESCAPABLE: return self::PARTIAL_ESCAPABLE; |
|
1 ignored issue
–
show
|
|||
194 | 78 | case self::ESCAPED_CHAR: return self::PARTIAL_ESCAPED_CHAR; |
|
1 ignored issue
–
show
|
|||
195 | 75 | case self::IN_DOUBLE_QUOTES: return self::PARTIAL_IN_DOUBLE_QUOTES; |
|
1 ignored issue
–
show
|
|||
196 | 72 | case self::IN_SINGLE_QUOTES: return self::PARTIAL_IN_SINGLE_QUOTES; |
|
1 ignored issue
–
show
|
|||
197 | 69 | case self::IN_PARENS: return self::PARTIAL_IN_PARENS; |
|
1 ignored issue
–
show
|
|||
198 | 66 | case self::REG_CHAR: return self::PARTIAL_REG_CHAR; |
|
1 ignored issue
–
show
|
|||
199 | 63 | case self::IN_PARENS_NOSP: return self::PARTIAL_IN_PARENS_NOSP; |
|
1 ignored issue
–
show
|
|||
200 | 60 | case self::TAGNAME: return self::PARTIAL_TAGNAME; |
|
1 ignored issue
–
show
|
|||
201 | 57 | case self::BLOCKTAGNAME: return self::PARTIAL_BLOCKTAGNAME; |
|
1 ignored issue
–
show
|
|||
202 | 54 | case self::ATTRIBUTENAME: return self::PARTIAL_ATTRIBUTENAME; |
|
1 ignored issue
–
show
|
|||
203 | 51 | case self::UNQUOTEDVALUE: return self::PARTIAL_UNQUOTEDVALUE; |
|
1 ignored issue
–
show
|
|||
204 | 48 | case self::SINGLEQUOTEDVALUE: return self::PARTIAL_SINGLEQUOTEDVALUE; |
|
1 ignored issue
–
show
|
|||
205 | 45 | case self::DOUBLEQUOTEDVALUE: return self::PARTIAL_DOUBLEQUOTEDVALUE; |
|
1 ignored issue
–
show
|
|||
206 | 42 | case self::ATTRIBUTEVALUE: return self::PARTIAL_ATTRIBUTEVALUE; |
|
1 ignored issue
–
show
|
|||
207 | 39 | case self::ATTRIBUTEVALUESPEC: return self::PARTIAL_ATTRIBUTEVALUESPEC; |
|
1 ignored issue
–
show
|
|||
208 | 36 | case self::ATTRIBUTE: return self::PARTIAL_ATTRIBUTE; |
|
1 ignored issue
–
show
|
|||
209 | 33 | case self::OPENTAG: return self::PARTIAL_OPENTAG; |
|
1 ignored issue
–
show
|
|||
210 | 30 | case self::CLOSETAG: return self::PARTIAL_CLOSETAG; |
|
1 ignored issue
–
show
|
|||
211 | 27 | case self::OPENBLOCKTAG: return self::PARTIAL_OPENBLOCKTAG; |
|
1 ignored issue
–
show
|
|||
212 | 24 | case self::CLOSEBLOCKTAG: return self::PARTIAL_CLOSEBLOCKTAG; |
|
1 ignored issue
–
show
|
|||
213 | 21 | case self::HTMLCOMMENT: return self::PARTIAL_HTMLCOMMENT; |
|
1 ignored issue
–
show
|
|||
214 | 18 | case self::PROCESSINGINSTRUCTION: return self::PARTIAL_PROCESSINGINSTRUCTION; |
|
1 ignored issue
–
show
|
|||
215 | 15 | case self::DECLARATION: return self::PARTIAL_DECLARATION; |
|
1 ignored issue
–
show
|
|||
216 | 12 | case self::CDATA: return self::PARTIAL_CDATA; |
|
1 ignored issue
–
show
|
|||
217 | 9 | case self::HTMLTAG: return self::PARTIAL_HTMLTAG; |
|
1 ignored issue
–
show
|
|||
218 | 6 | case self::HTMLBLOCKOPEN: return self::PARTIAL_HTMLBLOCKOPEN; |
|
1 ignored issue
–
show
|
|||
219 | 3 | case self::LINK_TITLE: return self::PARTIAL_LINK_TITLE; |
|
1 ignored issue
–
show
|
|||
220 | } |
||
221 | } |
||
222 | |||
400 |
This property has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.