| Conditions | 11 |
| Paths | 11 |
| Total Lines | 13 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| 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 |
||
| 52 | protected function canAddTag($choice): bool |
||
| 53 | { |
||
| 54 | return ($choice |
||
| 55 | && ($choice instanceof LinkHtml |
||
| 56 | || $choice instanceof Sub |
||
| 57 | || $choice instanceof Sup |
||
| 58 | || $choice instanceof Br |
||
| 59 | || $choice instanceof Footnote |
||
| 60 | || $choice instanceof FootNoteRef |
||
| 61 | || $choice instanceof RenderMultiMedia |
||
| 62 | || $choice instanceof Paragraph |
||
| 63 | || $choice instanceof listElement |
||
| 64 | || $choice instanceof Table |
||
| 65 | )); |
||
| 68 | } |