mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-10-14 07:46:21 +00:00
✨
This commit is contained in:
@@ -37,10 +37,14 @@ class MaskPatternTester{
|
||||
* @see \chillerlan\QRCode\QRCode::getBestMaskPattern()
|
||||
*
|
||||
* @param \chillerlan\QRCode\Data\QRMatrix $matrix
|
||||
*
|
||||
* @return \chillerlan\QRCode\Data\MaskPatternTester
|
||||
*/
|
||||
public function setMatrix(QRMatrix $matrix){
|
||||
public function setMatrix(QRMatrix $matrix):MaskPatternTester{
|
||||
$this->matrix = $matrix;
|
||||
$this->moduleCount = $this->matrix->size();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,16 +54,16 @@ class MaskPatternTester{
|
||||
* @see \chillerlan\QRCode\Data\QRMatrix::$maskPattern
|
||||
* @see \chillerlan\QRCode\QRCode::getBestMaskPattern()
|
||||
*
|
||||
* @return float
|
||||
* @return int
|
||||
*/
|
||||
public function testPattern():float{
|
||||
public function testPattern():int{
|
||||
$penalty = 0;
|
||||
|
||||
for($level = 1; $level <= 4; $level++){
|
||||
$penalty += call_user_func([$this, 'testLevel'.$level]);
|
||||
}
|
||||
|
||||
return $penalty;
|
||||
return (int)$penalty;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user