Browse Source

eat this, coverage report!

smiley 10 năm trước cách đây
mục cha
commit
8d3cd55e11
1 tập tin đã thay đổi với 5 bổ sung7 xóa
  1. 5 7
      src/Data/Number.php

+ 5 - 7
src/Data/Number.php

@@ -43,13 +43,11 @@ class Number extends QRDataBase implements QRDataInterface{
 
 		if($i < $this->dataLength){
 
-			switch(true){
-				case $this->dataLength - $i === 1:
-					$buffer->put($this->parseInt(substr($this->data, $i, $i + 1)), 4);
-					break;
-				case $this->dataLength - $i === 2:
-					$buffer->put($this->parseInt(substr($this->data, $i, $i + 2)), 7);
-					break;
+			if($this->dataLength - $i === 1){
+				$buffer->put($this->parseInt(substr($this->data, $i, $i + 1)), 4);
+			}
+			elseif($this->dataLength - $i === 2){
+				$buffer->put($this->parseInt(substr($this->data, $i, $i + 2)), 7);
 			}
 
 		}