Conditions | 4 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | public function execute() |
||
41 | { |
||
42 | $socket = $this->getSocket(self::SOCKET_STREAM); |
||
43 | if (!$socket || !$socket->hasNodes()) { |
||
44 | throw new InvalidArgumentException('There is no stream to close.'); |
||
45 | } |
||
46 | |||
47 | $streamValue = $socket->getNode(0)->getValue(); |
||
48 | if (!is_resource($streamValue)) { |
||
49 | throw new InvalidArgumentException('Invalid stream provided.'); |
||
50 | } |
||
51 | |||
52 | fclose($streamValue); |
||
53 | |||
54 | $this->activate(self::SOCKET_OUTPUT); |
||
55 | } |
||
56 | } |
||
57 |