| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function __construct(string $name, string $code) |
||
| 35 | { |
||
| 36 | // todo movie to db constraint |
||
| 37 | if (mb_strlen($code) !== 3) { |
||
|
|
|||
| 38 | // throw new \InvalidArgumentException(sprintf('"%s" should be exactly 3 characters long', $code)); |
||
| 39 | } |
||
| 40 | |||
| 41 | $this->code = mb_strtoupper($code); |
||
| 42 | $this->name = ucfirst($name); |
||
| 43 | } |
||
| 44 | |||
| 60 |
This check looks for the bodies of
ifstatements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.These
ifbodies can be removed. If you have an empty if but statements in theelsebranch, consider inverting the condition.could be turned into
This is much more concise to read.