mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-11-20 09:46:52 +00:00
:octocat: mark nullable types explicitly (https://github.com/chillerlan/php-qrcode/issues/276)
This commit is contained in:
@@ -175,7 +175,7 @@ class QRMatrix{
|
||||
*
|
||||
* @return int[][]|bool[][]
|
||||
*/
|
||||
public function getMatrix(bool $boolean = null):array{
|
||||
public function getMatrix(?bool $boolean = null):array{
|
||||
|
||||
if($boolean !== true){
|
||||
return $this->matrix;
|
||||
@@ -195,7 +195,7 @@ class QRMatrix{
|
||||
* @see \chillerlan\QRCode\Data\QRMatrix::getMatrix()
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function matrix(bool $boolean = null):array{
|
||||
public function matrix(?bool $boolean = null):array{
|
||||
return $this->getMatrix($boolean);
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ class QRMatrix{
|
||||
* 7 # 3
|
||||
* 6 5 4
|
||||
*/
|
||||
public function checkNeighbours(int $x, int $y, int $M_TYPE = null):int{
|
||||
public function checkNeighbours(int $x, int $y, ?int $M_TYPE = null):int{
|
||||
$bits = 0;
|
||||
|
||||
foreach($this::neighbours as $bit => [$ix, $iy]){
|
||||
@@ -552,7 +552,7 @@ class QRMatrix{
|
||||
*
|
||||
* ISO/IEC 18004:2000 Section 8.9
|
||||
*/
|
||||
public function setFormatInfo(MaskPattern $maskPattern = null):self{
|
||||
public function setFormatInfo(?MaskPattern $maskPattern = null):self{
|
||||
$this->maskPattern = $maskPattern;
|
||||
$bits = 0; // sets all format fields to false (test mode)
|
||||
|
||||
@@ -678,7 +678,7 @@ class QRMatrix{
|
||||
*
|
||||
* @throws \chillerlan\QRCode\Data\QRCodeDataException
|
||||
*/
|
||||
public function setLogoSpace(int $width, int $height = null, int $startX = null, int $startY = null):self{
|
||||
public function setLogoSpace(int $width, ?int $height = null, ?int $startX = null, ?int $startY = null):self{
|
||||
$height ??= $width;
|
||||
|
||||
// if width and height happen to be negative or 0 (default value), just return - nothing to do
|
||||
|
||||
Reference in New Issue
Block a user