@@ -110,12 +110,12 @@ class QRMatrix{
110110 /**
111111 * the matrix version - always set in QRMatrix, may be null in BitMatrix
112112 */
113- protected ? Version $ version = null ;
113+ protected Version | null $ version = null ;
114114
115115 /**
116116 * the current ECC level - always set in QRMatrix, may be null in BitMatrix
117117 */
118- protected ? EccLevel $ eccLevel = null ;
118+ protected EccLevel | null $ eccLevel = null ;
119119
120120 /**
121121 * the mask pattern that was used in the most recent operation, set via:
@@ -124,7 +124,7 @@ class QRMatrix{
124124 * - QRMatrix::mask()
125125 * - BitMatrix::readFormatInformation()
126126 */
127- protected ? MaskPattern $ maskPattern = null ;
127+ protected MaskPattern | null $ maskPattern = null ;
128128
129129 /**
130130 * the size (side length) of the matrix, including quiet zone (if created)
@@ -175,7 +175,7 @@ public function initFunctionalPatterns():static{
175175 *
176176 * @return int[][]|bool[][]
177177 */
178- public function getMatrix (bool $ boolean = null ):array {
178+ public function getMatrix (bool | null $ boolean = null ):array {
179179
180180 if ($ boolean !== true ){
181181 return $ this ->matrix ;
@@ -193,21 +193,21 @@ public function getMatrix(bool $boolean = null):array{
193193 /**
194194 * Returns the current version number
195195 */
196- public function getVersion ():? Version {
196+ public function getVersion ():Version | null {
197197 return $ this ->version ;
198198 }
199199
200200 /**
201201 * Returns the current ECC level
202202 */
203- public function getEccLevel ():? EccLevel {
203+ public function getEccLevel ():EccLevel | null {
204204 return $ this ->eccLevel ;
205205 }
206206
207207 /**
208208 * Returns the current mask pattern
209209 */
210- public function getMaskPattern ():? MaskPattern {
210+ public function getMaskPattern ():MaskPattern | null {
211211 return $ this ->maskPattern ;
212212 }
213213
@@ -342,7 +342,7 @@ public function isDark(int $M_TYPE):bool{
342342 * 7 # 3
343343 * 6 5 4
344344 */
345- public function checkNeighbours (int $ x , int $ y , int $ M_TYPE = null ):int {
345+ public function checkNeighbours (int $ x , int $ y , int | null $ M_TYPE = null ):int {
346346 $ bits = 0 ;
347347
348348 foreach ($ this ::neighbours as $ bit => [$ ix , $ iy ]){
@@ -507,7 +507,7 @@ public function setVersionNumber():static{
507507 *
508508 * ISO/IEC 18004:2000 Section 8.9
509509 */
510- public function setFormatInfo (MaskPattern $ maskPattern = null ):static {
510+ public function setFormatInfo (MaskPattern | null $ maskPattern = null ):static {
511511 $ this ->maskPattern = $ maskPattern ;
512512 $ bits = 0 ; // sets all format fields to false (test mode)
513513
@@ -633,7 +633,7 @@ public function invert():static{
633633 *
634634 * @throws \chillerlan\QRCode\Data\QRCodeDataException
635635 */
636- public function setLogoSpace (int $ width , int $ height = null , int $ startX = null , int $ startY = null ):static {
636+ public function setLogoSpace (int $ width , int | null $ height = null , int | null $ startX = null , int | null $ startY = null ):static {
637637 $ height ??= $ width ;
638638
639639 // if width and height happen to be negative or 0 (default value), just return - nothing to do
0 commit comments