From 00904e1b61ce6692d5926981d02f251a6cb23b9e Mon Sep 17 00:00:00 2001 From: Christian Hammer Date: Tue, 24 Mar 2020 15:27:18 +0100 Subject: [PATCH] changed coding style --- src/Gregwar/Captcha/CaptchaBuilder.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Gregwar/Captcha/CaptchaBuilder.php b/src/Gregwar/Captcha/CaptchaBuilder.php index f5e004b..115b80c 100644 --- a/src/Gregwar/Captcha/CaptchaBuilder.php +++ b/src/Gregwar/Captcha/CaptchaBuilder.php @@ -31,7 +31,7 @@ class CaptchaBuilder implements CaptchaBuilderInterface /** * @var array */ - protected $lineColor = array(); + protected $lineColor = null; /** * @var array @@ -269,14 +269,14 @@ public function setBackgroundImages(array $backgroundImages) */ protected function drawLine($image, $width, $height, $tcol = null) { - $red = $this->rand(100, 255); - $green = $this->rand(100, 255); - $blue = $this->rand(100, 255); - - if (!empty($this->lineColor)) { + if ($this->lineColor === null) { $red = $this->lineColor[0]; $green = $this->lineColor[1]; $blue = $this->lineColor[2]; + } else { + $red = $this->rand(100, 255); + $green = $this->rand(100, 255); + $blue = $this->rand(100, 255); } if ($tcol === null) {