1 | <?php |
||
13 | class Ftp implements AdapterInterface |
||
14 | { |
||
15 | const FTP_MODE_ASCII = FTP_ASCII; |
||
16 | const FTP_MODE_BINARY = FTP_BINARY; |
||
17 | |||
18 | protected $host = ''; |
||
19 | protected $username = ''; |
||
20 | protected $password = ''; |
||
21 | protected $filename = ''; |
||
22 | protected $port = 21; |
||
23 | |||
24 | protected $timeout = 90; |
||
25 | protected $handle = null; |
||
26 | |||
27 | /** |
||
28 | * You might think just connect to the ftp server from the constructor |
||
29 | * but psr-4 dictates that autoloadable classes MUST NOT... |
||
30 | * |
||
31 | * Quote: |
||
32 | * Autoloader implementations MUST NOT throw exceptions, MUST NOT raise errors of any level, and SHOULD NOT return a value. |
||
33 | * |
||
34 | * So we need to use authenticate() after we construct. |
||
35 | * |
||
36 | * @param string $host |
||
37 | * @param string $username |
||
38 | * @param string $password |
||
39 | * @param string $filename |
||
40 | * @param int $port; |
||
|
|||
41 | * @param int $timeout |
||
42 | */ |
||
43 | public function __construct($host = "", $username = "", $password = "", $filename = "", $port = 21, $timeout = 90) |
||
52 | |||
53 | /** |
||
54 | * We should be so nice to terminate the construction of we are done. |
||
55 | */ |
||
56 | public function __destruct() { |
||
61 | |||
62 | public function authenticate() |
||
84 | |||
85 | /** |
||
86 | * Read the previous scan results from the file system. |
||
87 | * |
||
88 | * @return array |
||
89 | */ |
||
90 | public function read() { |
||
114 | |||
115 | // TODO: This should be an universial exception |
||
116 | /** |
||
117 | * Write the report to the filesystem so we can reuse it |
||
118 | * at a later stace when we invoke Redbox\Scan\ScanService's scan() method. |
||
119 | * |
||
120 | * @param Report\Report|null $report |
||
121 | * @return bool |
||
122 | */ |
||
123 | public function write(Report\Report $report = null) { |
||
145 | |||
146 | } |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.