Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
6 / 6 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| IdleCommand | |
100.00% |
6 / 6 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| getName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getHelpText | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| run | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| 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 | } |