From 422392f674f311b446799d989caf006a3b7c8bfa Mon Sep 17 00:00:00 2001 From: smiley Date: Tue, 23 Feb 2016 15:11:36 +0100 Subject: [PATCH] scrunitizer happier --- .scrutinizer.yml | 1 + src/BitBuffer.php | 4 ---- src/Data/QRDataBase.php | 9 ++++++--- src/Data/QRDataInterface.php | 1 + src/Output/QRImage.php | 2 +- src/Util.php | 6 +----- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 81b40a199..c2102a228 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,3 +1,4 @@ filter: excluded_paths: - examples/* + - tests/* diff --git a/src/BitBuffer.php b/src/BitBuffer.php index c81b4c1d2..e3f445579 100644 --- a/src/BitBuffer.php +++ b/src/BitBuffer.php @@ -38,8 +38,6 @@ class BitBuffer{ /** * @param int $num * @param int $length - * - * @return $this */ public function put($num, $length){ @@ -51,8 +49,6 @@ class BitBuffer{ /** * @param bool $bit - * - * @return $this */ public function putBit($bit){ $bufIndex = floor($this->length / 8); diff --git a/src/Data/QRDataBase.php b/src/Data/QRDataBase.php index 4887af757..910ca12a7 100644 --- a/src/Data/QRDataBase.php +++ b/src/Data/QRDataBase.php @@ -52,9 +52,12 @@ class QRDataBase{ public function getLengthInBits($type){ switch(true){ - case $type >= 1 && $type <= 9: return $this->lengthBits[0]; // 1 - 9 - case $type <= 26 : return $this->lengthBits[1]; // 10 - 26 - case $type <= 40 : return $this->lengthBits[2]; // 27 - 40 + case $type >= 1 && $type <= 9: + return $this->lengthBits[0]; // 1 - 9 + case $type <= 26: + return $this->lengthBits[1]; // 10 - 26 + case $type <= 40: + return $this->lengthBits[2]; // 27 - 40 default: throw new QRCodeDataException('$type: '.$type); } diff --git a/src/Data/QRDataInterface.php b/src/Data/QRDataInterface.php index dd404c9ae..d9bbc4695 100644 --- a/src/Data/QRDataInterface.php +++ b/src/Data/QRDataInterface.php @@ -22,6 +22,7 @@ interface QRDataInterface{ /** * @param \chillerlan\QRCode\BitBuffer $buffer + * @return void */ public function write(BitBuffer &$buffer); diff --git a/src/Output/QRImage.php b/src/Output/QRImage.php index d61be5ca3..bca1c8e0c 100644 --- a/src/Output/QRImage.php +++ b/src/Output/QRImage.php @@ -59,7 +59,7 @@ class QRImage extends QROutputBase implements QROutputInterface{ } /** - * @return mixed + * @return string * @throws \chillerlan\QRCode\Output\QRCodeOutputException */ public function dump(){ diff --git a/src/Util.php b/src/Util.php index a27e5ce22..cf2bf2d9e 100644 --- a/src/Util.php +++ b/src/Util.php @@ -78,11 +78,7 @@ class Util{ $i += 2; } - if($i < $len){ - return false; - } - - return true; + return !($i < $len); } /**