| Conditions | 10 |
| Paths | 7 |
| Total Lines | 28 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
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 |
||
| 91 | public function equals(InverseFunctionalIdentifier $iri) |
||
| 92 | { |
||
| 93 | if ($this->mbox !== $iri->mbox) { |
||
| 94 | return false; |
||
| 95 | } |
||
| 96 | |||
| 97 | if ($this->mboxSha1Sum !== $iri->mboxSha1Sum) { |
||
| 98 | return false; |
||
| 99 | } |
||
| 100 | |||
| 101 | if ($this->openId !== $iri->openId) { |
||
| 102 | return false; |
||
| 103 | } |
||
| 104 | |||
| 105 | if (null === $this->account && null !== $iri->account) { |
||
| 106 | return false; |
||
| 107 | } |
||
| 108 | |||
| 109 | if (null !== $this->account && null === $iri->account) { |
||
| 110 | return false; |
||
| 111 | } |
||
| 112 | |||
| 113 | if (null !== $this->account && !$this->account->equals($iri->account)) { |
||
| 114 | return false; |
||
| 115 | } |
||
| 116 | |||
| 117 | return true; |
||
| 118 | } |
||
| 119 | |||
| 137 |