Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
75.00% |
3 / 4 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
| NoTransferSet | |
75.00% |
3 / 4 |
|
66.67% |
2 / 3 |
4.25 | |
0.00% |
0 / 1 |
| connectOnly | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| send | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
| end | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\FtpServer\Transfers; |
| 3 | |
| 4 | use function React\Promise\reject; |
| 5 | |
| 6 | class NoTransferSet implements TransferInterface |
| 7 | { |
| 8 | public function connectOnly(): \React\Promise\PromiseInterface |
| 9 | { |
| 10 | return reject(new \RuntimeException('No transfer mode (PORT or PASV) set.')); |
| 11 | } |
| 12 | |
| 13 | public function send(string $data, ?callable $onRejected = null): void |
| 14 | { |
| 15 | if ($onRejected !== null) { |
| 16 | call_user_func($onRejected, new \RuntimeException('No transfer mode (PORT or PASV) set.')); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | public function end(): void |
| 21 | { |
| 22 | } |
| 23 | } |