Completed
Pull Request — develop (#47)
by
unknown
10:56
created
src/PhpSpreadsheet/RichText/Run.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,8 @@
 block discarded – undo
79 79
     public function getHashCode()
80 80
     {
81 81
         return md5(
82
-            $this->getText().
83
-            $this->font->getHashCode().
82
+            $this->getText() .
83
+            $this->font->getHashCode() .
84 84
             __CLASS__
85 85
         );
86 86
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Helper/Migrator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -249,20 +249,20 @@  discard block
 block discarded – undo
249 249
         $to = array_values($this->getMapping());
250 250
 
251 251
         foreach ($patterns as $pattern) {
252
-            foreach (glob($path.$pattern) as $file) {
252
+            foreach (glob($path . $pattern) as $file) {
253 253
                 $original = file_get_contents($file);
254 254
                 $converted = str_replace($from, $to, $original);
255 255
 
256 256
                 if ($original !== $converted) {
257
-                    echo $file." converted\n";
257
+                    echo $file . " converted\n";
258 258
                     file_put_contents($file, $converted);
259 259
                 }
260 260
             }
261 261
         }
262 262
 
263 263
         // Do the recursion in subdirectory
264
-        foreach (glob($path.'/*', GLOB_ONLYDIR) as $subpath) {
265
-            if (strpos($subpath, $path.'/') === 0) {
264
+        foreach (glob($path . '/*', GLOB_ONLYDIR) as $subpath) {
265
+            if (strpos($subpath, $path . '/') === 0) {
266 266
                 $this->recursiveReplace($subpath);
267 267
             }
268 268
         }
@@ -271,8 +271,8 @@  discard block
 block discarded – undo
271 271
     public function migrate()
272 272
     {
273 273
         $path = realpath(getcwd());
274
-        echo 'This will search and replace recursively in '.$path.PHP_EOL;
275
-        echo 'You MUST backup your files first, or you risk losing data.'.PHP_EOL;
274
+        echo 'This will search and replace recursively in ' . $path . PHP_EOL;
275
+        echo 'You MUST backup your files first, or you risk losing data.' . PHP_EOL;
276 276
         echo 'Are you sure ? (y/n)';
277 277
 
278 278
         $confirm = fread(STDIN, 1);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Helper/Sample.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function getPageHeading()
56 56
     {
57
-        return $this->isIndex() ? '' : '<h1>'.str_replace('_', ' ', $this->getScriptFilename()).'</h1>';
57
+        return $this->isIndex() ? '' : '<h1>' . str_replace('_', ' ', $this->getScriptFilename()) . '</h1>';
58 58
     }
59 59
 
60 60
     /**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     {
67 67
         // Populate samples
68 68
         $files = [];
69
-        foreach (glob(realpath(__DIR__.'/../../../samples').'/*.php') as $file) {
69
+        foreach (glob(realpath(__DIR__ . '/../../../samples') . '/*.php') as $file) {
70 70
             $info = pathinfo($file);
71 71
             $name = str_replace('_', ' ', preg_replace('/(|\.php)/', '', $info['filename']));
72 72
             if (preg_match('/^\d+/', $name)) {
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     private function getTemporaryFolder()
114 114
     {
115
-        $tempFolder = sys_get_temp_dir().'/phpspreadsheet';
115
+        $tempFolder = sys_get_temp_dir() . '/phpspreadsheet';
116 116
         if (!is_dir($tempFolder)) {
117 117
             mkdir($tempFolder);
118 118
         }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function getFilename($filename, $extension = 'xlsx')
132 132
     {
133
-        return $this->getTemporaryFolder().'/'.str_replace('.php', '.'.$extension, basename($filename));
133
+        return $this->getTemporaryFolder() . '/' . str_replace('.php', '.' . $extension, basename($filename));
134 134
     }
135 135
 
136 136
     /**
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         $temporaryFilename = tempnam($this->getTemporaryFolder(), 'phpspreadsheet-');
146 146
         unlink($temporaryFilename);
147 147
 
148
-        return $temporaryFilename.'.'.$extension;
148
+        return $temporaryFilename . '.' . $extension;
149 149
     }
150 150
 
151 151
     public function log($message)
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     public function logEndingNotes()
160 160
     {
161 161
         // Do not show execution time for index
162
-        $this->log('Peak memory usage: '.(memory_get_peak_usage(true) / 1024 / 1024).'MB');
162
+        $this->log('Peak memory usage: ' . (memory_get_peak_usage(true) / 1024 / 1024) . 'MB');
163 163
     }
164 164
 
165 165
     /**
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $callTime = $callEndTime - $callStartTime;
176 176
         $reflection = new \ReflectionClass($writer);
177 177
         $format = $reflection->getShortName();
178
-        $message = "Write {$format} format to <code>{$path}</code>  in ".sprintf('%.4f', $callTime).' seconds';
178
+        $message = "Write {$format} format to <code>{$path}</code>  in " . sprintf('%.4f', $callTime) . ' seconds';
179 179
 
180 180
         $this->log($message);
181 181
     }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     {
192 192
         $callEndTime = microtime(true);
193 193
         $callTime = $callEndTime - $callStartTime;
194
-        $message = "Read {$format} format from <code>{$path}</code>  in ".sprintf('%.4f', $callTime).' seconds';
194
+        $message = "Read {$format} format from <code>{$path}</code>  in " . sprintf('%.4f', $callTime) . ' seconds';
195 195
 
196 196
         $this->log($message);
197 197
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Helper/HTML.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -665,7 +665,7 @@
 block discarded – undo
665 665
             $richtextRun->getFont()->setSize($this->size);
666 666
         }
667 667
         if ($this->color) {
668
-            $richtextRun->getFont()->setColor(new \PhpOffice\PhpSpreadsheet\Style\Color('ff'.$this->color));
668
+            $richtextRun->getFont()->setColor(new \PhpOffice\PhpSpreadsheet\Style\Color('ff' . $this->color));
669 669
         }
670 670
         if ($this->bold) {
671 671
             $richtextRun->getFont()->setBold(true);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Style.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                                 $rangeStart[1] : $rangeEnd[1] - $yMax + $y;
328 328
 
329 329
                             // build range for region
330
-                            $range = $colStart.$rowStart.':'.$colEnd.$rowEnd;
330
+                            $range = $colStart . $rowStart . ':' . $colEnd . $rowEnd;
331 331
 
332 332
                             // retrieve relevant style array for region
333 333
                             $regionStyles = $pStyles;
@@ -630,14 +630,14 @@  discard block
 block discarded – undo
630 630
         }
631 631
 
632 632
         return md5(
633
-            $this->fill->getHashCode().
634
-            $this->font->getHashCode().
635
-            $this->borders->getHashCode().
636
-            $this->alignment->getHashCode().
637
-            $this->numberFormat->getHashCode().
638
-            $hashConditionals.
639
-            $this->protection->getHashCode().
640
-            ($this->quotePrefix ? 't' : 'f').
633
+            $this->fill->getHashCode() .
634
+            $this->font->getHashCode() .
635
+            $this->borders->getHashCode() .
636
+            $this->alignment->getHashCode() .
637
+            $this->numberFormat->getHashCode() .
638
+            $hashConditionals .
639
+            $this->protection->getHashCode() .
640
+            ($this->quotePrefix ? 't' : 'f') .
641 641
             __CLASS__
642 642
         );
643 643
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/PDF.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,10 +61,10 @@
 block discarded – undo
61 61
         $includePath = str_replace('\\', '/', get_include_path());
62 62
         $rendererPath = str_replace('\\', '/', $pdfLibraryPath);
63 63
         if (strpos($rendererPath, $includePath) === false) {
64
-            set_include_path(get_include_path().PATH_SEPARATOR.$pdfLibraryPath);
64
+            set_include_path(get_include_path() . PATH_SEPARATOR . $pdfLibraryPath);
65 65
         }
66 66
 
67
-        $rendererName = '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\'.$pdfLibraryName;
67
+        $rendererName = '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\' . $pdfLibraryName;
68 68
         $this->renderer = new $rendererName($spreadsheet);
69 69
     }
70 70
 
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Xls.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -214,14 +214,14 @@  discard block
 block discarded – undo
214 214
         $this->documentSummaryInformation = $this->writeDocumentSummaryInformation();
215 215
         // initialize OLE Document Summary Information
216 216
         if (isset($this->documentSummaryInformation) && !empty($this->documentSummaryInformation)) {
217
-            $OLE_DocumentSummaryInformation = new \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File(OLE::ascToUcs(chr(5).'DocumentSummaryInformation'));
217
+            $OLE_DocumentSummaryInformation = new \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File(OLE::ascToUcs(chr(5) . 'DocumentSummaryInformation'));
218 218
             $OLE_DocumentSummaryInformation->append($this->documentSummaryInformation);
219 219
         }
220 220
 
221 221
         $this->summaryInformation = $this->writeSummaryInformation();
222 222
         // initialize OLE Summary Information
223 223
         if (isset($this->summaryInformation) && !empty($this->summaryInformation)) {
224
-            $OLE_SummaryInformation = new \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File(OLE::ascToUcs(chr(5).'SummaryInformation'));
224
+            $OLE_SummaryInformation = new \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File(OLE::ascToUcs(chr(5) . 'SummaryInformation'));
225 225
             $OLE_SummaryInformation->append($this->summaryInformation);
226 226
         }
227 227
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                     // create an Drawing Object for the dropdown
368 368
                     $oDrawing = new BaseDrawing();
369 369
                     // get the coordinates of drawing
370
-                    $cDrawing = Cell::stringFromColumnIndex($iInc - 1).$rangeBounds[0][1];
370
+                    $cDrawing = Cell::stringFromColumnIndex($iInc - 1) . $rangeBounds[0][1];
371 371
                     $oDrawing->setCoordinates($cDrawing);
372 372
                     $oDrawing->setWorksheet($sheet);
373 373
 
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
         $dataProp .= pack('v', 0x000A);
667 667
         $dataProp .= pack('v', 0x0000);
668 668
         // value
669
-        $dataProp .= 'Worksheet'.chr(0);
669
+        $dataProp .= 'Worksheet' . chr(0);
670 670
 
671 671
         $dataSection[] = [
672 672
             'summary' => ['pack' => 'V', 'data' => 0x0D],
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/CSV.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         }
132 132
         if ($this->includeSeparatorLine) {
133 133
             // Write the separator line if required
134
-            fwrite($fileHandle, 'sep='.$this->getDelimiter().$this->lineEnding);
134
+            fwrite($fileHandle, 'sep=' . $this->getDelimiter() . $this->lineEnding);
135 135
         }
136 136
 
137 137
         //    Identify the range that we need to extract from the worksheet
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         // Write rows to file
142 142
         for ($row = 1; $row <= $maxRow; ++$row) {
143 143
             // Convert the row to an array...
144
-            $cellsArray = $sheet->rangeToArray('A'.$row.':'.$maxCol.$row, '', $this->preCalculateFormulas);
144
+            $cellsArray = $sheet->rangeToArray('A' . $row . ':' . $maxCol . $row, '', $this->preCalculateFormulas);
145 145
             // ... and write to the file
146 146
             $this->writeLine($fileHandle, $cellsArray[0]);
147 147
         }
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
             foreach ($pValues as $element) {
346 346
                 // Escape enclosures
347
-                $element = str_replace($this->enclosure, $this->enclosure.$this->enclosure, $element);
347
+                $element = str_replace($this->enclosure, $this->enclosure . $this->enclosure, $element);
348 348
 
349 349
                 // Add delimiter
350 350
                 if ($writeDelimiter) {
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
                 }
355 355
 
356 356
                 // Add enclosed string
357
-                $line .= $this->enclosure.$element.$this->enclosure;
357
+                $line .= $this->enclosure . $element . $this->enclosure;
358 358
             }
359 359
 
360 360
             // Add line ending
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Ods/Content.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@
 block discarded – undo
212 212
                     } catch (Exception $e) {
213 213
                         $formula_value = $cell->getValue();
214 214
                     }
215
-                    $objWriter->writeAttribute('table:formula', 'of:'.$cell->getValue());
215
+                    $objWriter->writeAttribute('table:formula', 'of:' . $cell->getValue());
216 216
                     if (is_numeric($formula_value)) {
217 217
                         $objWriter->writeAttribute('office:value-type', 'float');
218 218
                     } else {
Please login to merge, or discard this patch.