Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
33.33% |
2 / 6 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
| IdleCommand | |
33.33% |
2 / 6 |
|
66.67% |
2 / 3 |
5.67 | |
0.00% |
0 / 1 |
| getName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getHelpText | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| run | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | namespace Apie\FtpServer\SiteCommands; |
| 3 | |
| 4 | use Apie\Core\Context\ApieContext; |
| 5 | use React\Socket\ConnectionInterface; |
| 6 | |
| 7 | class IdleCommand implements SiteCommandInterface |
| 8 | { |
| 9 | public function getName(): string |
| 10 | { |
| 11 | return 'IDLE'; |
| 12 | } |
| 13 | |
| 14 | public function getHelpText(): string |
| 15 | { |
| 16 | return 'Waits for a short moment before responding.'; |
| 17 | } |
| 18 | |
| 19 | public function run(ApieContext $apieContext, string $arg = ''): ApieContext |
| 20 | { |
| 21 | $conn = $apieContext->getContext(ConnectionInterface::class); |
| 22 | $conn->write("200 Idle for 1 usec\r\n"); |
| 23 | usleep(1); |
| 24 | return $apieContext; |
| 25 | } |
| 26 | } |