Skip to content

Commit b1efebb

Browse files
committed
:octocat: remove remaining instances of empty()
(cherry picked from commit 2b7c9b7)
1 parent 8104863 commit b1efebb

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/Common/GenericGFPoly.php

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

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

src/Decoder/DecoderResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ final class DecoderResult{
4646
*/
4747
public function __construct(?iterable $properties = null){
4848

49-
if(!empty($properties)){
49+
if($properties !== null){
5050

5151
foreach($properties as $property => $value){
5252

src/Detector/Detector.php

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

5858
// Anything above version 1 has an alignment pattern
59-
if(!empty($provisionalVersion->getAlignmentPattern())){
59+
if($provisionalVersion->getAlignmentPattern() !== []){
6060
// Guess where a "bottom right" finder pattern would have been
6161
$bottomRightX = ($topRight->getX() - $topLeft->getX() + $bottomLeft->getX());
6262
$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
@@ -134,7 +134,7 @@ public function dump(?string $file = null):string{
134134

135135
foreach($paths as $M_TYPE => $path){
136136

137-
if(empty($path)){
137+
if($path === []){
138138
continue;
139139
}
140140

src/Output/QRMarkupSVG.php

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

77-
if(!empty($this->options->svgDefs)){
77+
if($this->options->svgDefs !== ''){
7878
$svg .= sprintf('<defs>%1$s%2$s</defs>%2$s', $this->options->svgDefs, $this->eol);
7979
}
8080

@@ -144,7 +144,7 @@ protected function paths():string{
144144

145145
$path = implode($this->eol, $chonks);
146146

147-
if(empty($path)){
147+
if($path === ''){
148148
continue;
149149
}
150150

0 commit comments

Comments
 (0)