Completed
Pull Request — develop (#218)
by
unknown
63:56
created
tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php 2 patches
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 block discarded – undo
8 8
 
9 9
 namespace PhpOffice\PhpSpreadsheetTests\Writer\Xls\Workbook;
10 10
 
11
-use PhpOffice\PhpSpreadsheet\Spreadsheet;
12
-use PhpOffice\PhpSpreadsheet\Writer\Xls\Parser;
13
-use PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook;
11
+use PhpOffice\PhpSpreadsheet\Spreadsheet;
12
+use PhpOffice\PhpSpreadsheet\Writer\Xls\Parser;
13
+use PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook;
14 14
 use PHPUnit_Framework_TestCase;
15 15
 
16 16
 class WorkbookTest extends PHPUnit_Framework_TestCase
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     private $workbook;
20 20
 
21 21
 
22
-    protected function setUp(){
22
+    protected function setUp() {
23 23
         $spreadsheet = new Spreadsheet();
24 24
         $strTotal = 0;
25 25
         $strUnique = 0;
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         $colors = [];
28 28
         $parser = new Parser();
29 29
 
30
-        $this->workbook = new Workbook($spreadsheet, $strTotal, $strUnique, $str_table, $colors,$parser);
30
+        $this->workbook = new Workbook($spreadsheet, $strTotal, $strUnique, $str_table, $colors, $parser);
31 31
     }
32 32
 
33 33
     protected function tearDown()
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      *
41 41
      * @param mixed $expectedResult
42 42
      */
43
-    public function testAddColor($testColors,$expectedResult){
43
+    public function testAddColor($testColors, $expectedResult) {
44 44
         $result = 0;
45 45
 
46 46
         $workbookReflection = new \ReflectionClass(Workbook::class);
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $methodAddColor->setAccessible(TRUE);
50 50
         $propertyPalette->setAccessible(TRUE);
51 51
 
52
-        foreach($testColors as $testColor){
52
+        foreach ($testColors as $testColor) {
53 53
             $result = $methodAddColor->invoke($this->workbook, $testColor);
54 54
         }
55 55
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $this->assertEquals($expectedResult, $palette);
59 59
     }
60 60
 
61
-    public function providerAddColor(){
61
+    public function providerAddColor() {
62 62
         $this->setUp();
63 63
 
64 64
         $workbookReflection = new \ReflectionClass(Workbook::class);
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
      * @param array $palette palette color
129 129
      * @return string rgb string
130 130
      */
131
-    public static function paletteToColor($palette){
132
-        return self::right('00'.dechex(intval($palette[0])),2)
133
-            .self::right('00'.dechex(intval($palette[1])),2)
134
-            .self::right('00'.dechex(intval($palette[2])),2);
131
+    public static function paletteToColor($palette) {
132
+        return self::right('00' . dechex(intval($palette[0])), 2)
133
+            .self::right('00' . dechex(intval($palette[1])), 2)
134
+            .self::right('00' . dechex(intval($palette[2])), 2);
135 135
     }
136 136
 
137 137
     /**
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
      * @param integer $nbchar number of char at right of string
142 142
      * @return string
143 143
      */
144
-    public static function right($value,$nbchar)
144
+    public static function right($value, $nbchar)
145 145
     {
146
-            return mb_substr($value,mb_strlen($value)-$nbchar, $nbchar);
146
+            return mb_substr($value, mb_strlen($value) - $nbchar, $nbchar);
147 147
     }
148 148
 }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Xls/Workbook.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -343,9 +343,9 @@
 block discarded – undo
343 343
             if ($colorIndex) {
344 344
                 $this->colors[$rgb] = $colorIndex;
345 345
             } else {
346
-                if(count($this->colors) == 0){
346
+                if (count($this->colors) == 0) {
347 347
                     $lastColor = 7;
348
-                }else{
348
+                } else {
349 349
                     $lastColor = end($this->colors);
350 350
                 }
351 351
                 if ($lastColor < 57) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -345,7 +345,7 @@
 block discarded – undo
345 345
             } else {
346 346
                 if(count($this->colors) == 0){
347 347
                     $lastColor = 7;
348
-                }else{
348
+                } else{
349 349
                     $lastColor = end($this->colors);
350 350
                 }
351 351
                 if ($lastColor < 57) {
Please login to merge, or discard this patch.