Style fixes
This commit is contained in:
parent
4107783e27
commit
dc5a5670a0
|
|
@ -397,7 +397,7 @@ class Color extends Supervisor
|
||||||
return new self(self::$indexedColors[$colorIndex]);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@ use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
class ColorTest extends TestCase
|
class ColorTest extends TestCase
|
||||||
{
|
{
|
||||||
public function testNewColor()
|
public function testNewColor(): void
|
||||||
{
|
{
|
||||||
$color = new Color('FF123456');
|
$color = new Color('FF123456');
|
||||||
self::assertEquals('FF123456', $color->getARGB());
|
self::assertEquals('FF123456', $color->getARGB());
|
||||||
self::assertEquals('123456', $color->getRGB());
|
self::assertEquals('123456', $color->getRGB());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testARGBSetter()
|
public function testARGBSetter(): void
|
||||||
{
|
{
|
||||||
$color = new Color();
|
$color = new Color();
|
||||||
$color->setARGB('80123456');
|
$color->setARGB('80123456');
|
||||||
|
|
@ -22,21 +22,21 @@ class ColorTest extends TestCase
|
||||||
self::assertEquals('123456', $color->getRGB());
|
self::assertEquals('123456', $color->getRGB());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testARGBSetterEmpty()
|
public function testARGBSetterEmpty(): void
|
||||||
{
|
{
|
||||||
$color = new Color();
|
$color = new Color();
|
||||||
$color->setARGB();
|
$color->setARGB();
|
||||||
self::assertEquals(Color::COLOR_BLACK, $color->getARGB());
|
self::assertEquals(Color::COLOR_BLACK, $color->getARGB());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testARGBSetterInvalid()
|
public function testARGBSetterInvalid(): void
|
||||||
{
|
{
|
||||||
$color = new Color('80123456');
|
$color = new Color('80123456');
|
||||||
$color->setARGB('INVALID COLOR');
|
$color->setARGB('INVALID COLOR');
|
||||||
self::assertEquals('80123456', $color->getARGB());
|
self::assertEquals('80123456', $color->getARGB());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRGBSetter()
|
public function testRGBSetter(): void
|
||||||
{
|
{
|
||||||
$color = new Color();
|
$color = new Color();
|
||||||
$color->setRGB('123456');
|
$color->setRGB('123456');
|
||||||
|
|
@ -44,21 +44,21 @@ class ColorTest extends TestCase
|
||||||
self::assertEquals('FF123456', $color->getARGB());
|
self::assertEquals('FF123456', $color->getARGB());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRGBSetterEmpty()
|
public function testRGBSetterEmpty(): void
|
||||||
{
|
{
|
||||||
$color = new Color();
|
$color = new Color();
|
||||||
$color->setRGB();
|
$color->setRGB();
|
||||||
self::assertEquals(Color::COLOR_BLACK, $color->getARGB());
|
self::assertEquals(Color::COLOR_BLACK, $color->getARGB());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRGBSetterInvalid()
|
public function testRGBSetterInvalid(): void
|
||||||
{
|
{
|
||||||
$color = new Color('80123456');
|
$color = new Color('80123456');
|
||||||
$color->setRGB('INVALID COLOR');
|
$color->setRGB('INVALID COLOR');
|
||||||
self::assertEquals('123456', $color->getRGB());
|
self::assertEquals('123456', $color->getRGB());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testARGBFromArray()
|
public function testARGBFromArray(): void
|
||||||
{
|
{
|
||||||
$color = new Color();
|
$color = new Color();
|
||||||
$color->applyFromArray(['argb' => '80123456']);
|
$color->applyFromArray(['argb' => '80123456']);
|
||||||
|
|
@ -66,7 +66,7 @@ class ColorTest extends TestCase
|
||||||
self::assertEquals('123456', $color->getRGB());
|
self::assertEquals('123456', $color->getRGB());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRGBFromArray()
|
public function testRGBFromArray(): void
|
||||||
{
|
{
|
||||||
$color = new Color();
|
$color = new Color();
|
||||||
$color->applyFromArray(['rgb' => '123456']);
|
$color->applyFromArray(['rgb' => '123456']);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue