:octocat: +QRMatrix::init()

This commit is contained in:
codemasher
2020-02-19 20:51:37 +01:00
parent 2dde546ef9
commit 04842a3c31
2 changed files with 16 additions and 7 deletions
+15
View File
@@ -200,6 +200,21 @@ class QRMatrix{
$this->matrix = array_fill(0, $this->moduleCount, array_fill(0, $this->moduleCount, $this::M_NULL));
}
/**
* shortcut to initialize the matrix
*/
public function init(int $maskPattern, bool $test = null):QRMatrix{
return $this
->setFinderPattern()
->setSeparators()
->setAlignmentPattern()
->setTimingPattern()
->setVersionNumber($test)
->setFormatInfo($maskPattern, $test)
->setDarkModule()
;
}
/**
*
*/