Completed
Push — master ( ef738c...5c5eb6 )
by Emmanuel
06:50
created
src/GlSyncFtp.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -147,9 +147,9 @@
 block discarded – undo
147 147
                 $syncdir($src, $dst);
148 148
             }
149 149
             $this->syncDirectory(
150
-                 $src,
151
-                     $dst,
152
-                     $syncop
150
+                    $src,
151
+                        $dst,
152
+                        $syncop
153 153
             );
154 154
         }
155 155
     }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -123,17 +123,17 @@  discard block
 block discarded – undo
123 123
      */
124 124
     private function getFiles($root, $relative, &$listfiles, &$listdirs)
125 125
     {
126
-        $files = $this->sftp->rawlist($root . '/' . $relative);
126
+        $files = $this->sftp->rawlist($root.'/'.$relative);
127 127
         if ($files === false) {
128 128
             return;
129 129
         }
130 130
         foreach ($files as $name => $raw) {
131 131
             if (($name != '.') && ($name != '..')) {
132 132
                 if ($raw['type'] == NET_SFTP_TYPE_DIRECTORY) {
133
-                    $listdirs[$relative . '/' . $name] = $raw;
134
-                    $this->getFiles($root, $relative . '/' . $name, $listfiles, $listdirs);
133
+                    $listdirs[$relative.'/'.$name] = $raw;
134
+                    $this->getFiles($root, $relative.'/'.$name, $listfiles, $listdirs);
135 135
                 } else {
136
-                    $listfiles[$relative . '/' . $name] = $raw;
136
+                    $listfiles[$relative.'/'.$name] = $raw;
137 137
                 }
138 138
             }
139 139
         }
@@ -168,15 +168,15 @@  discard block
 block discarded – undo
168 168
      * @param string $dst
169 169
      * @param callable|null $syncop
170 170
      */
171
-    private function syncDelete($src, $dst,callable $syncop = null) {
171
+    private function syncDelete($src, $dst, callable $syncop = null) {
172 172
         $files = [];
173 173
         $dirs  = [];
174 174
         $this->getFiles($dst, "", $files, $dirs);
175 175
 
176 176
         // delete on ftp server, files not present in local directory
177 177
         foreach ($files as $name => $raw) {
178
-            if (!file_exists($src . $name)) {
179
-                $filepathFtp = $dst . strtr($name, ["\\" => "/"]);
178
+            if (!file_exists($src.$name)) {
179
+                $filepathFtp = $dst.strtr($name, ["\\" => "/"]);
180 180
                 if ($syncop) {
181 181
                     $syncop(self::DELETE_FILE, $filepathFtp);
182 182
                 }
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
         // delete on ftp server, unknowns directories
188 188
         $dirs = array_reverse($dirs);
189 189
         foreach ($dirs as $name => $raw) {
190
-            if (!file_exists($src . $name)) {
191
-                $filepathFtp = $dst . strtr($name, ["\\" => "/"]);
190
+            if (!file_exists($src.$name)) {
191
+                $filepathFtp = $dst.strtr($name, ["\\" => "/"]);
192 192
                 if ($syncop) {
193 193
                     $syncop(self::DELETE_DIR, $filepathFtp);
194 194
                 }
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
          * @var SplFileInfo $dir
222 222
          */
223 223
         foreach ($finderdir as $dir) {
224
-            $dirpathFtp = $dst . "/" . strtr($dir->getRelativePathname(), ["\\" => "/"]);
224
+            $dirpathFtp = $dst."/".strtr($dir->getRelativePathname(), ["\\" => "/"]);
225 225
             $stat       = $this->sftp->stat($dirpathFtp);
226 226
             if (!$stat) {
227 227
                 if ($syncop) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
          * @var SplFileInfo $file
241 241
          */
242 242
         foreach ($finderdir as $file) {
243
-            $filepathFtp = $dst . "/" . strtr($file->getRelativePathname(), ["\\" => "/"]);
243
+            $filepathFtp = $dst."/".strtr($file->getRelativePathname(), ["\\" => "/"]);
244 244
             $stat        = $this->sftp->stat($filepathFtp);
245 245
             if (!$stat) {
246 246
                 if ($syncop) {
Please login to merge, or discard this patch.