| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | 62 | public function close() |
|
| 40 | { |
||
| 41 | 62 | if ($this->state == self::STATE_CLOSED) { |
|
| 42 | 31 | throw StreamStateException::alreadyClosed(); |
|
| 43 | } |
||
| 44 | |||
| 45 | 62 | if ($this->state != self::STATE_READY) { |
|
| 46 | 18 | throw StreamStateException::notOpened(); |
|
| 47 | } |
||
| 48 | |||
| 49 | 44 | $this->state = self::STATE_CLOSED; |
|
| 50 | 44 | } |
|
| 51 | |||
| 72 |