Skip to content

Commit 2b7c9b7

Browse files
committed
:octocat: remove remaining instances of empty()
1 parent 3a610d2 commit 2b7c9b7

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

src/Common/GenericGFPoly.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class GenericGFPoly{
3939
public function __construct(array $coefficients, int|null $degree = null){
4040
$degree ??= 0;
4141

42-
if(empty($coefficients)){
42+
if($coefficients === []){
4343
throw new QRCodeException('arg $coefficients is empty');
4444
}
4545

src/Decoder/DecoderResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ final class DecoderResult{
4949
*/
5050
public function __construct(iterable|null $properties = null){
5151

52-
if(!empty($properties)){
52+
if($properties !== null){
5353

5454
foreach($properties as $property => $value){
5555

src/Detector/Detector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function detect():BitMatrix{
5757
$alignmentPattern = null;
5858

5959
// Anything above version 1 has an alignment pattern
60-
if(!empty($provisionalVersion->getAlignmentPattern())){
60+
if($provisionalVersion->getAlignmentPattern() !== []){
6161
// Guess where a "bottom right" finder pattern would have been
6262
$bottomRightX = ($topRight->getX() - $topLeft->getX() + $bottomLeft->getX());
6363
$bottomRightY = ($topRight->getY() - $topLeft->getY() + $bottomLeft->getY());

src/Output/QREps.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ protected function paths():string{
148148

149149
foreach($paths as $M_TYPE => $path){
150150

151-
if(empty($path)){
151+
if($path === []){
152152
continue;
153153
}
154154

src/Output/QRMarkupSVG.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected function getCssClass(int $M_TYPE = 0):string{
6666
protected function createMarkup(bool $saveToFile):string{
6767
$svg = $this->header();
6868

69-
if(!empty($this->options->svgDefs)){
69+
if($this->options->svgDefs !== ''){
7070
$svg .= sprintf('<defs>%1$s%2$s</defs>%2$s', $this->options->svgDefs, $this->eol);
7171
}
7272

@@ -131,7 +131,7 @@ protected function paths():string{
131131

132132
$path = implode($this->eol, $chonks);
133133

134-
if(empty($path)){
134+
if($path === ''){
135135
continue;
136136
}
137137

src/Output/QRStringJSON.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function row(int $y, array $row):array|null{
9999
}
100100
}
101101

102-
if(!empty($matrixRow['modules'])){
102+
if($matrixRow['modules'] !== []){
103103
return $matrixRow;
104104
}
105105

src/QRCode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ protected function addMatrixModifications(QRMatrix $matrix):QRMatrix{
152152
protected function initOutputInterface(QRMatrix $matrix):QROutputInterface{
153153
$outputInterface = $this->options->outputInterface;
154154

155-
if(empty($outputInterface) || !class_exists($outputInterface)){
155+
if(!class_exists($outputInterface)){
156156
throw new QRCodeOutputException('invalid output class');
157157
}
158158

0 commit comments

Comments
 (0)