diff --git a/src/Common/GenericGFPoly.php b/src/Common/GenericGFPoly.php index 4023e74d2..7360a1db9 100644 --- a/src/Common/GenericGFPoly.php +++ b/src/Common/GenericGFPoly.php @@ -38,7 +38,7 @@ final class GenericGFPoly{ public function __construct(array $coefficients, ?int $degree = null){ $degree ??= 0; - if(empty($coefficients)){ + if($coefficients === []){ throw new QRCodeException('arg $coefficients is empty'); } diff --git a/src/Decoder/DecoderResult.php b/src/Decoder/DecoderResult.php index ef0f245d9..b0d605e8e 100644 --- a/src/Decoder/DecoderResult.php +++ b/src/Decoder/DecoderResult.php @@ -46,7 +46,7 @@ final class DecoderResult{ */ public function __construct(?iterable $properties = null){ - if(!empty($properties)){ + if($properties !== null){ foreach($properties as $property => $value){ diff --git a/src/Detector/Detector.php b/src/Detector/Detector.php index e173d8b6c..eb48f4ffb 100644 --- a/src/Detector/Detector.php +++ b/src/Detector/Detector.php @@ -56,7 +56,7 @@ final class Detector{ $alignmentPattern = null; // Anything above version 1 has an alignment pattern - if(!empty($provisionalVersion->getAlignmentPattern())){ + if($provisionalVersion->getAlignmentPattern() !== []){ // Guess where a "bottom right" finder pattern would have been $bottomRightX = ($topRight->getX() - $topLeft->getX() + $bottomLeft->getX()); $bottomRightY = ($topRight->getY() - $topLeft->getY() + $bottomLeft->getY()); diff --git a/src/Output/QREps.php b/src/Output/QREps.php index 76dd50b37..394c4f96f 100644 --- a/src/Output/QREps.php +++ b/src/Output/QREps.php @@ -134,7 +134,7 @@ class QREps extends QROutputAbstract{ foreach($paths as $M_TYPE => $path){ - if(empty($path)){ + if($path === []){ continue; } diff --git a/src/Output/QRMarkupSVG.php b/src/Output/QRMarkupSVG.php index 735c4180b..571195ea2 100644 --- a/src/Output/QRMarkupSVG.php +++ b/src/Output/QRMarkupSVG.php @@ -74,7 +74,7 @@ class QRMarkupSVG extends QRMarkup{ protected function createMarkup(bool $saveToFile):string{ $svg = $this->header(); - if(!empty($this->options->svgDefs)){ + if($this->options->svgDefs !== ''){ $svg .= sprintf('%1$s%2$s%2$s', $this->options->svgDefs, $this->eol); } @@ -144,7 +144,7 @@ class QRMarkupSVG extends QRMarkup{ $path = implode($this->eol, $chonks); - if(empty($path)){ + if($path === ''){ continue; }