| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 56 | public function ifWritable(Closure $do, int $conn = 0) : bool |
||
| 57 | { |
||
| 58 | if (!$this->connected($conn)) { |
||
| 59 | return false; |
||
| 60 | } |
||
| 61 | |||
| 62 | if ($this->writable[$conn] ?? true) { |
||
| 63 | $do($this, $conn); |
||
| 64 | return true; |
||
| 65 | } |
||
| 66 | |||
| 67 | ($this->waits[$conn] ?? $this->waits[$conn] = Promise::deferred()) |
||
| 68 | ->then(function (object $sock, int $conn) use ($do) { |
||
| 69 | /** |
||
| 70 | * @var static $sock |
||
| 71 | */ |
||
| 72 | $sock->ifWritable($do, $conn); |
||
| 73 | }) |
||
| 74 | ; |
||
| 75 | |||
| 76 | return false; |
||
| 77 | } |
||
| 92 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.