Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| PbszCommand | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| run | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | namespace Apie\FtpServer\Commands; |
| 3 | |
| 4 | use Apie\Core\Context\ApieContext; |
| 5 | use React\Socket\ConnectionInterface; |
| 6 | |
| 7 | class PbszCommand implements CommandInterface |
| 8 | { |
| 9 | public function run(ApieContext $apieContext, string $arg = ''): ApieContext |
| 10 | { |
| 11 | $conn = $apieContext->getContext(ConnectionInterface::class); |
| 12 | $arg = trim($arg); |
| 13 | if ($arg === '0') { |
| 14 | $conn->write("200 PBSZ=0\r\n"); |
| 15 | } else { |
| 16 | $conn->write("501 Syntax error in parameters or arguments. Only PBSZ 0 is supported.\r\n"); |
| 17 | } |
| 18 | return $apieContext; |
| 19 | } |
| 20 | } |