Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
UserCommand
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 run
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2namespace Apie\FtpServer\Commands;
3
4use Apie\Core\Context\ApieContext;
5use Apie\FtpServer\FtpConstants;
6use React\Socket\ConnectionInterface;
7
8class UserCommand implements CommandInterface
9{
10    public function run(ApieContext $apieContext, string $arg = ''): ApieContext
11    {
12        $conn = $apieContext->getContext(ConnectionInterface::class);
13        if ($arg) {
14            $conn->write("331 Username OK, need password\r\n");
15            return $apieContext
16                ->withContext(FtpConstants::USERNAME, $arg);
17        } else {
18            // TODO
19        }
20
21        return $apieContext;
22    }
23}