@@ -90,13 +90,13 @@ public function connect() {
9090 $ this ->socket ->connect ($ timeout );
9191
9292 // Read banner message
93- $ this ->expect ($ this ->getResponse (), array ( 220 ) );
93+ $ this ->expect ($ this ->getResponse (), [ 220 ] );
9494
9595 // User & password
9696 if ($ this ->url ->getUser ()) {
9797 try {
98- $ this ->expect ($ this ->sendCommand ('USER %s ' , $ this ->url ->getUser ()), array ( 331 ) );
99- $ this ->expect ($ this ->sendCommand ('PASS %s ' , $ this ->url ->getPassword ()), array ( 230 ) );
98+ $ this ->expect ($ this ->sendCommand ('USER %s ' , $ this ->url ->getUser ()), [ 331 ] );
99+ $ this ->expect ($ this ->sendCommand ('PASS %s ' , $ this ->url ->getPassword ()), [ 230 ] );
100100 } catch (\peer \ProtocolException $ e ) {
101101 $ this ->socket ->close ();
102102 throw new AuthenticationException (sprintf (
@@ -118,7 +118,7 @@ public function connect() {
118118 $ this ->setupListParser ();
119119
120120 // Retrieve root directory
121- sscanf ($ this ->expect ($ this ->sendCommand ('PWD ' ), array ( 257 ) ), '"%[^"]" ' , $ dir );
121+ sscanf ($ this ->expect ($ this ->sendCommand ('PWD ' ), [ 257 ] ), '"%[^"]" ' , $ dir );
122122 $ this ->root = new FtpDir (strtr ($ dir , '\\' , '/ ' ), $ this );
123123
124124 return $ this ;
@@ -129,7 +129,7 @@ public function connect() {
129129 *
130130 */
131131 protected function setupListParser () {
132- $ type = $ this ->expect ($ this ->sendCommand ('SYST ' ), array ( 215 ) );
132+ $ type = $ this ->expect ($ this ->sendCommand ('SYST ' ), [ 215 ] );
133133 if ('Windows_NT ' == $ type ) {
134134 $ this ->parser = new WindowsFtpListParser ();
135135 } else {
@@ -161,8 +161,8 @@ public function close() {
161161 * @return peer.Socket
162162 */
163163 public function transferSocket () {
164- $ port = $ this ->expect ($ this ->sendCommand ('PASV ' ), array ( 227 ) );
165- $ a = $ p = array () ;
164+ $ port = $ this ->expect ($ this ->sendCommand ('PASV ' ), [ 227 ] );
165+ $ a = $ p = [] ;
166166 sscanf ($ port , '%*[^(] (%d,%d,%d,%d,%d,%d) ' , $ a [0 ], $ a [1 ], $ a [2 ], $ a [3 ], $ p [0 ], $ p [1 ]);
167167
168168 // Open transfer socket
@@ -252,7 +252,7 @@ public function listingOf($name, $options= null) {
252252 $ transfer ->close ();
253253 return null ;
254254 } else if (150 === $ code ) { // Listing
255- $ list = array () ;
255+ $ list = [] ;
256256 while ($ line = $ transfer ->readLine ()) {
257257 $ list []= $ line ;
258258 }
@@ -262,7 +262,7 @@ public function listingOf($name, $options= null) {
262262 if (450 === $ code ) { // No such file or directory
263263 return null ;
264264 } else { // Some FTP servers send an empty directory listing
265- $ this ->expect ($ r , array ( 226 ) );
265+ $ this ->expect ($ r , [ 226 ] );
266266 return $ list ? $ list : null ;
267267 }
268268 } else { // Unexpected response
0 commit comments