| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function setId($id) |
||
| 25 | { |
||
| 26 | if ($this->id !== null) { |
||
| 27 | throw new BadMethodCallException( |
||
| 28 | "Идентификатор у сущности уже установлен"); |
||
| 29 | } |
||
| 30 | |||
| 31 | if (empty($id)) {//$id < 1 |
||
| 32 | throw new InvalidArgumentException("Неверный индентификатор"); |
||
| 33 | } |
||
| 34 | |||
| 35 | $this->id = $id; |
||
| 36 | return $this; |
||
| 37 | } |
||
| 38 | |||
| 63 |