diff --git a/src/PhpSpreadsheet/Style/Color.php b/src/PhpSpreadsheet/Style/Color.php index 956efb9e..d308c5c7 100644 --- a/src/PhpSpreadsheet/Style/Color.php +++ b/src/PhpSpreadsheet/Style/Color.php @@ -397,7 +397,7 @@ class Color extends Supervisor return new self(self::$indexedColors[$colorIndex]); } - return ($background) ? new self(self::COLOR_WHITE): new self(self::COLOR_BLACK); + return ($background) ? new self(self::COLOR_WHITE) : new self(self::COLOR_BLACK); } /** diff --git a/tests/PhpSpreadsheetTests/Style/ColorTest.php b/tests/PhpSpreadsheetTests/Style/ColorTest.php index 0f1092bd..8ae6518a 100644 --- a/tests/PhpSpreadsheetTests/Style/ColorTest.php +++ b/tests/PhpSpreadsheetTests/Style/ColorTest.php @@ -7,14 +7,14 @@ use PHPUnit\Framework\TestCase; class ColorTest extends TestCase { - public function testNewColor() + public function testNewColor(): void { $color = new Color('FF123456'); self::assertEquals('FF123456', $color->getARGB()); self::assertEquals('123456', $color->getRGB()); } - public function testARGBSetter() + public function testARGBSetter(): void { $color = new Color(); $color->setARGB('80123456'); @@ -22,21 +22,21 @@ class ColorTest extends TestCase self::assertEquals('123456', $color->getRGB()); } - public function testARGBSetterEmpty() + public function testARGBSetterEmpty(): void { $color = new Color(); $color->setARGB(); self::assertEquals(Color::COLOR_BLACK, $color->getARGB()); } - public function testARGBSetterInvalid() + public function testARGBSetterInvalid(): void { $color = new Color('80123456'); $color->setARGB('INVALID COLOR'); self::assertEquals('80123456', $color->getARGB()); } - public function testRGBSetter() + public function testRGBSetter(): void { $color = new Color(); $color->setRGB('123456'); @@ -44,21 +44,21 @@ class ColorTest extends TestCase self::assertEquals('FF123456', $color->getARGB()); } - public function testRGBSetterEmpty() + public function testRGBSetterEmpty(): void { $color = new Color(); $color->setRGB(); self::assertEquals(Color::COLOR_BLACK, $color->getARGB()); } - public function testRGBSetterInvalid() + public function testRGBSetterInvalid(): void { $color = new Color('80123456'); $color->setRGB('INVALID COLOR'); self::assertEquals('123456', $color->getRGB()); } - public function testARGBFromArray() + public function testARGBFromArray(): void { $color = new Color(); $color->applyFromArray(['argb' => '80123456']); @@ -66,7 +66,7 @@ class ColorTest extends TestCase self::assertEquals('123456', $color->getRGB()); } - public function testRGBFromArray() + public function testRGBFromArray(): void { $color = new Color(); $color->applyFromArray(['rgb' => '123456']);