| Conditions | 14 |
| Paths | 14 |
| Total Lines | 33 |
| Code Lines | 29 |
| 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 |
||
| 47 | private function isCondition($node) |
||
| 48 | { |
||
| 49 | return |
||
| 50 | $node instanceof BinaryOp |
||
| 51 | && |
||
| 52 | ( |
||
| 53 | $node instanceof Equal |
||
| 54 | || |
||
| 55 | $node instanceof NotEqual |
||
| 56 | || |
||
| 57 | $node instanceof Greater |
||
| 58 | || |
||
| 59 | $node instanceof GreaterOrEqual |
||
| 60 | || |
||
| 61 | $node instanceof Smaller |
||
| 62 | || |
||
| 63 | $node instanceof SmallerOrEqual |
||
| 64 | || |
||
| 65 | $node instanceof Identical |
||
| 66 | || |
||
| 67 | $node instanceof NotIdentical |
||
| 68 | || |
||
| 69 | $node instanceof LogicalAnd |
||
| 70 | || |
||
| 71 | $node instanceof LogicalOr |
||
| 72 | || |
||
| 73 | $node instanceof LogicalXor |
||
| 74 | || |
||
| 75 | $node instanceof Coalesce |
||
| 76 | || |
||
| 77 | $node instanceof Spaceship |
||
| 78 | ); |
||
| 79 | } |
||
| 80 | |||
| 118 |