Passed
Branch master (10bb44)
by Nikita
04:18
created
src/Gdaemon.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
120 120
                 . "(Error $errno: $errstr)");
121 121
         }
122 122
 
123
-         $this->getSocket();
123
+            $this->getSocket();
124 124
     }
125 125
 
126 126
     /**
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     public function setConfig(array $config)
94 94
     {
95 95
         foreach ($this->configurable as $setting) {
96
-            if ( ! isset($config[$setting])) {
96
+            if (!isset($config[$setting])) {
97 97
                 continue;
98 98
             }
99 99
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         // $this->_connection = @fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout);
114 114
         $this->_connection = stream_socket_client("tcp://{$this->host}:{$this->port}", $errno, $errstr, 30);
115 115
 
116
-        if ( ! $this->_connection) {
116
+        if (!$this->_connection) {
117 117
             throw new RuntimeException('Could not connect to host: '
118 118
                 . $this->host
119 119
                 . ', port:' . $this->port
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     protected function getConnection()
130 130
     {
131
-        if (! is_resource($this->_connection)) {
131
+        if (!is_resource($this->_connection)) {
132 132
             $this->disconnect();
133 133
             $this->connect();
134 134
         }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     protected function login($username, $password, $privateKey, $privateKeyPass)
146 146
     {
147
-        $writeBinn= new BinnList;
147
+        $writeBinn = new BinnList;
148 148
 
149 149
         $writeBinn->addInt16(self::DAEMON_SERVER_MODE_AUTH);
150 150
         $writeBinn->addStr($username);
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
             return $this->_socket;
207 207
         }
208 208
 
209
-        set_error_handler(function () {});
209
+        set_error_handler(function() {});
210 210
         $this->_socket = socket_import_stream($this->getConnection());
211 211
         restore_error_handler();
212 212
 
213
-        if (! $this->_socket) {
213
+        if (!$this->_socket) {
214 214
             $this->disconnect();
215 215
             throw new RuntimeException('Could not import socket');
216 216
         }
Please login to merge, or discard this patch.
src/GdaemonFiles.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             throw new RuntimeException('Couldn\'t upload file: ' . isset($results[1]) ? $results[1] : 'Unknown');
70 70
         }
71 71
 
72
-        while(!feof($fileHandle)) {
72
+        while (!feof($fileHandle)) {
73 73
             $this->writeSocket(fread($fileHandle, $this->maxBufsize));
74 74
         }
75 75
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         $filesize = $results[2];
134 134
         $writed = 0;
135 135
 
136
-        while($writed < $filesize) {
136
+        while ($writed < $filesize) {
137 137
             if ($filesize - $writed > $this->maxBufsize) {
138 138
                 $readlen = $this->maxBufsize;
139 139
             }
@@ -164,11 +164,11 @@  discard block
 block discarded – undo
164 164
      */
165 165
     public function listFiles($directory)
166 166
     {
167
-        $writeBinn= new BinnList;
167
+        $writeBinn = new BinnList;
168 168
 
169 169
         $writeBinn->addUint8(self::FSERV_READDIR);
170
-        $writeBinn->addStr($directory);     // Dir path
171
-        $writeBinn->addUint8(0);       // Mode
170
+        $writeBinn->addStr($directory); // Dir path
171
+        $writeBinn->addUint8(0); // Mode
172 172
 
173 173
         $read = $this->writeAndReadSocket($writeBinn->serialize());
174 174
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
         $returnList = [];
192 192
 
193
-        foreach($filesList as &$file) {
193
+        foreach ($filesList as &$file) {
194 194
 
195 195
             if (basename($file[0]) == '.' OR basename($file[0]) == '..') {
196 196
                 continue;
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
      */
209 209
     public function directoryContents($directory)
210 210
     {
211
-        $writeBinn= new BinnList;
211
+        $writeBinn = new BinnList;
212 212
 
213 213
         $writeBinn->addUint8(self::FSERV_READDIR);
214
-        $writeBinn->addStr($directory);     // Dir path
215
-        $writeBinn->addUint8(1);       // Mode
214
+        $writeBinn->addStr($directory); // Dir path
215
+        $writeBinn->addUint8(1); // Mode
216 216
 
217 217
         $read = $this->writeAndReadSocket($writeBinn->serialize());
218 218
 
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 
235 235
         $returnList = [];
236 236
 
237
-        foreach($filesList as &$file) {
237
+        foreach ($filesList as &$file) {
238 238
             if (basename($file[0]) == '.' OR basename($file[0]) == '..') {
239 239
                 continue;
240 240
             }
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
         $writeBinn->addUint8(self::FSERV_MOVE);
337 337
         $writeBinn->addStr($oldPath);
338 338
         $writeBinn->addStr($newPath);
339
-        $writeBinn->addBool(true);            // Copy
339
+        $writeBinn->addBool(true); // Copy
340 340
 
341 341
         $read = $this->writeAndReadSocket($writeBinn->serialize());
342 342
 
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
      */
388 388
     public function metadata($path)
389 389
     {
390
-        $writeBinn= new BinnList;
390
+        $writeBinn = new BinnList;
391 391
 
392 392
         $writeBinn->addUint8(self::FSERV_FILEINFO);
393 393
         $writeBinn->addStr($path);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,8 +136,7 @@
 block discarded – undo
136 136
         while($writed < $filesize) {
137 137
             if ($filesize - $writed > $this->maxBufsize) {
138 138
                 $readlen = $this->maxBufsize;
139
-            }
140
-            else {
139
+            } else {
141 140
                 $readlen = $filesize - $writed;
142 141
             }
143 142
 
Please login to merge, or discard this patch.