Skip to content

Commit 19c5131

Browse files
author
dsiddhath2
committed
Fixed the Counting of non-countable objects by removing the count in the code
1 parent 69f7e67 commit 19c5131

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/PHPZxing/PHPZxingDecoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ private function createImages($output) {
183183
* Function that creates a command using the options provided
184184
*/
185185
public function prepare() {
186-
if($this->_ARRAY_IMAGES != null || count($this->_ARRAY_IMAGES) > 0) {
186+
if(is_array($this->_ARRAY_IMAGES)) {
187187
return $this->prepareImageArray();
188188
} else {
189189
return $this->prepareSingleImage();
@@ -208,7 +208,7 @@ public function decode($image = null) {
208208
if(is_array($image)) {
209209
$this->setArrayImages($image);
210210

211-
if($this->_ARRAY_IMAGES == null || count($this->_ARRAY_IMAGES) <= 0) {
211+
if($this->_ARRAY_IMAGES == null) {
212212
throw new \Exception("Nothing to decode");
213213
}
214214

src/examples/example.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
error_reporting(E_ALL);
3+
ini_set('display_errors', 1);
4+
25
require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "PHPZxing" . DIRECTORY_SEPARATOR . "PHPZxingBase.php";
36
require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "PHPZxing" . DIRECTORY_SEPARATOR . "PHPZxingDecoder.php";
47
require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "PHPZxing" . DIRECTORY_SEPARATOR . "ZxingImage.php";

0 commit comments

Comments
 (0)