Completed
Push — master ( 67f111...ee3fe7 )
by Sebastian
03:47
created
src/Backup/Sync/Ftp.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
     {
84 84
 
85 85
         // silence ftp errors
86
-        $old  = error_reporting(0);
86
+        $old = error_reporting(0);
87 87
         if (!$ftpConnection = ftp_connect($this->host)) {
88 88
             throw new Exception(
89 89
                 sprintf(
Please login to merge, or discard this patch.
src/Cli/Executable/RedisCli.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
      */
79 79
     public function runCommand($command)
80 80
     {
81
-        if(!isset($this->availableCommands[$command])) {
81
+        if (!isset($this->availableCommands[$command])) {
82 82
             throw new Exception('Unknown redis-cli command');
83 83
         }
84 84
         $this->command = $command;
Please login to merge, or discard this patch.
src/Util/Str.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
      */
186 186
     public static function withTrailingSlash($string)
187 187
     {
188
-        return $string . (substr($string, -1) !== '/' ? '/' : '');
188
+        return $string.(substr($string, -1) !== '/' ? '/' : '');
189 189
     }
190 190
 
191 191
     /**
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
      */
208 208
     public static function withLeadingSlash($string)
209 209
     {
210
-        return (substr($string, 0, 1) !== '/' ? '/' : '') . $string;
210
+        return (substr($string, 0, 1) !== '/' ? '/' : '').$string;
211 211
     }
212 212
 
213 213
     /**
@@ -230,6 +230,6 @@  discard block
 block discarded – undo
230 230
      */
231 231
     public static function appendPluralS($subject, $amount)
232 232
     {
233
-        return $subject . ($amount == 1 ? '' : (substr($subject, -1) == 's' ? '\'s' : 's'));
233
+        return $subject.($amount == 1 ? '' : (substr($subject, -1) == 's' ? '\'s' : 's'));
234 234
     }
235 235
 }
Please login to merge, or discard this patch.
src/Util/Cli.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         'mongodump' => [],
50 50
         'mysqldump' => [
51 51
             '/usr/local/mysql/bin', // Mac OS X
52
-            '/usr/mysql/bin',       // Linux
52
+            '/usr/mysql/bin', // Linux
53 53
         ],
54 54
         'tar'       => [],
55 55
     ];
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public static function detectCmdLocationInPath($cmd, $path)
158 158
     {
159
-        $command = $path . DIRECTORY_SEPARATOR . $cmd;
159
+        $command = $path.DIRECTORY_SEPARATOR.$cmd;
160 160
         $bin     = self::isExecutable($command);
161 161
         if (null === $bin) {
162 162
             throw new RuntimeException(sprintf('wrong path specified for \'%s\': %s', $cmd, $path));
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     public static function detectCmdLocationInPaths($cmd, array $paths)
193 193
     {
194 194
         foreach ($paths as $path) {
195
-            $command = $path . DIRECTORY_SEPARATOR . $cmd;
195
+            $command = $path.DIRECTORY_SEPARATOR.$cmd;
196 196
             $bin     = self::isExecutable($command);
197 197
             if (null !== $bin) {
198 198
                 return $bin;
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
             return $path;
299 299
         }
300 300
 
301
-        $file = $base . DIRECTORY_SEPARATOR . $path;
301
+        $file = $base.DIRECTORY_SEPARATOR.$path;
302 302
 
303 303
         if ($useIncludePath && !file_exists($file)) {
304 304
             $includePathFile = stream_resolve_include_path($path);
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 
332 332
         $styledLines = [];
333 333
         foreach ($lines as $line) {
334
-            $styledLines[] = strlen($line) ? $style . str_pad($line, $padding) . "\x1b[0m" : '';
334
+            $styledLines[] = strlen($line) ? $style.str_pad($line, $padding)."\x1b[0m" : '';
335 335
         }
336 336
 
337 337
         return implode(PHP_EOL, $styledLines);
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
      */
347 347
     public static function formatWithAsterisk($buffer, $length = 75)
348 348
     {
349
-        return $buffer . str_repeat('*', $length - strlen($buffer)) . PHP_EOL;
349
+        return $buffer.str_repeat('*', $length - strlen($buffer)).PHP_EOL;
350 350
     }
351 351
 
352 352
     /**
@@ -360,10 +360,10 @@  discard block
 block discarded – undo
360 360
             if ('.' === $file || '..' === $file) {
361 361
                 continue;
362 362
             }
363
-            if (is_dir($dir . '/' . $file)) {
364
-                self::removeDir($dir . '/' . $file);
363
+            if (is_dir($dir.'/'.$file)) {
364
+                self::removeDir($dir.'/'.$file);
365 365
             } else {
366
-                unlink($dir . '/' . $file);
366
+                unlink($dir.'/'.$file);
367 367
             }
368 368
         }
369 369
         rmdir($dir);
Please login to merge, or discard this patch.
src/Backup/Compressor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function __construct($cmd, $pathToCmd = null)
74 74
     {
75
-        $this->path     = $pathToCmd . (!empty($pathToCmd) ? DIRECTORY_SEPARATOR : '');
75
+        $this->path     = $pathToCmd.(!empty($pathToCmd) ? DIRECTORY_SEPARATOR : '');
76 76
         $this->cmd      = $cmd;
77 77
         $this->suffix   = self::$availableCompressors[$cmd]['suffix'];
78 78
         $this->mimeType = self::$availableCompressors[$cmd]['mime'];
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         }
126 126
 
127 127
         if (!isset(self::$availableCompressors[$name])) {
128
-            throw new Exception('invalid compressor:' . $name);
128
+            throw new Exception('invalid compressor:'.$name);
129 129
         }
130 130
         return new static($name, $path);
131 131
     }
Please login to merge, or discard this patch.
src/Backup/Crypter/Abstraction.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
         $crypt = $this->execute($target);
34 34
         $name  = strtolower(get_class($this));
35 35
 
36
-        $result->debug($name . ':' . $this->getExecutable($target)->getCommandLinePrintable());
36
+        $result->debug($name.':'.$this->getExecutable($target)->getCommandLinePrintable());
37 37
 
38 38
         if (!$crypt->wasSuccessful()) {
39
-            throw new Exception($name . ' failed:' . PHP_EOL . $crypt->getStdErr());
39
+            throw new Exception($name.' failed:'.PHP_EOL.$crypt->getStdErr());
40 40
         }
41 41
     }
42 42
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function simulate(Target $target, Result $result)
50 50
     {
51 51
         $result->debug(
52
-            'execute encryption:' . PHP_EOL .
52
+            'execute encryption:'.PHP_EOL.
53 53
             $this->getExecutable($target)->getCommandLinePrintable()
54 54
         );
55 55
     }
Please login to merge, or discard this patch.
src/Backup/Sync/AmazonS3v2.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     public function sync(Target $target, Result $result)
33 33
     {
34 34
         $sourcePath = $target->getPathname();
35
-        $targetPath = $this->path . $target->getFilename();
35
+        $targetPath = $this->path.$target->getFilename();
36 36
 
37 37
         $s3 = S3Client::factory(
38 38
             [
Please login to merge, or discard this patch.
src/Backup/Sync/SoftLayer.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -105,19 +105,19 @@  discard block
 block discarded – undo
105 105
     public function sync(Target $target, Result $result)
106 106
     {
107 107
         $sourcePath = $target->getPathname();
108
-        $targetPath = $this->path . $target->getFilename();
108
+        $targetPath = $this->path.$target->getFilename();
109 109
 
110 110
         $options       = array('adapter' => ObjectStorage_Http_Client::SOCKET, 'timeout' => 20);
111 111
         $objectStorage = new ObjectStorage($this->host, $this->user, $this->secret, $options);
112 112
 
113
-        $result->debug('softlayer source: ' . $sourcePath);
114
-        $result->debug('softlayer target: ' . $targetPath);
113
+        $result->debug('softlayer source: '.$sourcePath);
114
+        $result->debug('softlayer target: '.$targetPath);
115 115
 
116 116
         try {
117 117
             /** @var \ObjectStorage_Container $container */
118
-            $container = $objectStorage->with($this->container . $targetPath)
118
+            $container = $objectStorage->with($this->container.$targetPath)
119 119
                                        ->setLocalFile($sourcePath)
120
-                                       ->setMeta('description', 'PHPBU Backup: ' . date('r', time()))
120
+                                       ->setMeta('description', 'PHPBU Backup: '.date('r', time()))
121 121
                                        ->setHeader('Content-Type', $target->getMimeType());
122 122
             $container->create();
123 123
         } catch (\Exception $e) {
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
     public function simulate(Target $target, Result $result)
137 137
     {
138 138
         $result->debug(
139
-            'sync backup to SoftLayer' . PHP_EOL
140
-            . '  host:      ' . $this->host . PHP_EOL
141
-            . '  user:      ' . $this->user . PHP_EOL
142
-            . '  secret:     ********' . PHP_EOL
143
-            . '  container: ' . $this->container . PHP_EOL
144
-            . '  location:  ' . $this->path
139
+            'sync backup to SoftLayer'.PHP_EOL
140
+            . '  host:      '.$this->host.PHP_EOL
141
+            . '  user:      '.$this->user.PHP_EOL
142
+            . '  secret:     ********'.PHP_EOL
143
+            . '  container: '.$this->container.PHP_EOL
144
+            . '  location:  '.$this->path
145 145
         );
146 146
     }
147 147
 }
Please login to merge, or discard this patch.
src/Backup/Sync/AmazonS3v3.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $stream = $this->getFileHandle($this->getUploadPath($target), 'w');
44 44
 
45 45
         try {
46
-            while(!feof($source)) {
46
+            while (!feof($source)) {
47 47
                 fwrite($stream, fread($source, 4096));
48 48
             }
49 49
             fclose($stream);
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     {
67 67
         $handle = fopen($path, $mode);
68 68
         if (!is_resource($handle)) {
69
-            throw new Exception('fopen failed: could not open stream ' . $path);
69
+            throw new Exception('fopen failed: could not open stream '.$path);
70 70
         }
71 71
         return $handle;
72 72
     }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function getUploadPath(Target $target)
81 81
     {
82
-        return 's3://' . $this->bucket
82
+        return 's3://'.$this->bucket
83 83
                . (substr($this->path, 0, 1) == '/' ? '' : '/')
84 84
                . $this->path
85 85
                . (substr($this->path, -1, 1) == '/' ? '' : '/')
Please login to merge, or discard this patch.