@@ -77,7 +77,7 @@ final class MaskPattern{
*/
public function __construct(int $maskPattern){
- if((0b111 & $maskPattern) !== $maskPattern){
+ if(($maskPattern & 0b111) !== $maskPattern){
throw new QRCodeException('invalid mask pattern');
}
@@ -349,7 +349,7 @@ class QRMatrix{
$ix += $x;
$iy += $y;
- // $M_TYPE is given, skip if the field is not the same type
+ // check if the field is the same type
if($M_TYPE !== null && !$this->checkType($ix, $iy, $M_TYPE)){
continue;