1 | <?php |
||
8 | class Ftp extends FtpAbstract |
||
9 | { |
||
10 | const TIMEOUT = 'timeout'; |
||
11 | const MODE = 'mode'; |
||
12 | const RESUME_POS = 'resumepos'; |
||
13 | const START_POS = 'startpos'; |
||
14 | const PASSIVE_MODE = 'passive_mode'; |
||
15 | |||
16 | /** |
||
17 | * Connection timeout in second |
||
18 | * @return int |
||
19 | */ |
||
20 | 2 | protected function getTimeout() |
|
24 | |||
25 | /** |
||
26 | * Transfer mode (FTP_ASCII | FTP_BINARY) |
||
27 | * @return int |
||
28 | */ |
||
29 | 1 | protected function getMode() |
|
33 | |||
34 | /** |
||
35 | * Begin download position in remote file |
||
36 | * @return int |
||
37 | */ |
||
38 | 1 | protected function getResumePos() |
|
42 | |||
43 | /** |
||
44 | * Begin upload position in local file to put in remote file |
||
45 | * @return int |
||
46 | */ |
||
47 | 1 | protected function getStartPos() |
|
51 | |||
52 | /** |
||
53 | * Begin upload position in local file to put in remote file |
||
54 | * @return int |
||
55 | */ |
||
56 | 1 | protected function getPassiveMode() |
|
60 | |||
61 | /** |
||
62 | * @param string $host |
||
63 | * @param int $port |
||
64 | * @return $this |
||
65 | * @throws FtpException |
||
66 | */ |
||
67 | 1 | public function connect($host, $port = 21) |
|
73 | |||
74 | /** |
||
75 | * @param string $host |
||
76 | * @param int $port |
||
77 | * @param int $timeout |
||
78 | * @return resource |
||
79 | * @codeCoverageIgnore |
||
80 | */ |
||
81 | protected function ftpConnect($host, $port = 21, $timeout = 90) |
||
85 | |||
86 | /** |
||
87 | * @param string $user |
||
88 | * @param string $pass |
||
89 | * @return bool |
||
90 | * @throws FtpException |
||
91 | */ |
||
92 | 2 | public function login($user, $pass) |
|
102 | |||
103 | /** |
||
104 | * @param resource $ftpStream |
||
105 | * @param string $username |
||
106 | * @param string $password |
||
107 | * @return bool |
||
108 | * @codeCoverageIgnore |
||
109 | */ |
||
110 | protected function ftpLogin($ftpStream, $username, $password) |
||
114 | |||
115 | /** |
||
116 | * @param string $localFile |
||
117 | * @param string $remoteFile |
||
118 | * @return bool |
||
119 | */ |
||
120 | 1 | public function get($localFile, $remoteFile) |
|
124 | |||
125 | /** |
||
126 | * Put file on ftp server |
||
127 | * @param string $remoteFile |
||
128 | * @param string $localFile |
||
129 | * @return bool |
||
130 | */ |
||
131 | 1 | public function put($remoteFile, $localFile) |
|
135 | |||
136 | /** |
||
137 | * @param resource $ftpStream |
||
138 | * @param string $localFile |
||
139 | * @param string $remoteFile |
||
140 | * @param int $mode |
||
141 | * @param int $resumePos |
||
142 | * @return bool |
||
143 | * @codeCoverageIgnore |
||
144 | */ |
||
145 | protected function ftpGet($ftpStream, $localFile, $remoteFile, $mode, $resumePos) |
||
149 | |||
150 | /** |
||
151 | * @param resource $ftpStream |
||
152 | * @param string $remoteFile |
||
153 | * @param string $localFile |
||
154 | * @param int $mode |
||
155 | * @param int $startpos |
||
156 | * @return bool |
||
157 | * @codeCoverageIgnore |
||
158 | */ |
||
159 | protected function ftpPut($ftpStream, $remoteFile, $localFile, $mode, $startpos) |
||
163 | |||
164 | /** |
||
165 | * @param string $file |
||
166 | * @return bool |
||
167 | */ |
||
168 | 1 | public function delete($file) |
|
172 | |||
173 | /** |
||
174 | * @param resource $ftpStream |
||
175 | * @param string $path |
||
176 | * @return bool |
||
177 | * @codeCoverageIgnore |
||
178 | */ |
||
179 | protected function ftpDelete($ftpStream, $path) |
||
183 | |||
184 | /** |
||
185 | * @return bool |
||
186 | */ |
||
187 | 1 | public function close() |
|
191 | |||
192 | /** |
||
193 | * @param resource $ftpStream |
||
194 | * @return bool |
||
195 | * @codeCoverageIgnore |
||
196 | */ |
||
197 | protected function ftpClose($ftpStream) |
||
201 | |||
202 | /** |
||
203 | * @param resource $ftpStream |
||
204 | * @param bool $pasv |
||
205 | * @return bool |
||
206 | * @codeCoverageIgnore |
||
207 | */ |
||
208 | protected function ftpPasv($ftpStream, $pasv) |
||
212 | } |
||
213 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: