Skip to content

Commit 1b26475

Browse files
fix: make implicitly nullable params explicit
1 parent c01758c commit 1b26475

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Common/BitMatrix.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class BitMatrix
4040
/**
4141
* @throws InvalidArgumentException if a dimension is smaller than zero
4242
*/
43-
public function __construct(int $width, int $height = null)
43+
public function __construct(int $width, ?int $height = null)
4444
{
4545
if (null === $height) {
4646
$height = $width;
@@ -132,7 +132,7 @@ public function setRegion(int $left, int $top, int $width, int $height) : void
132132
/**
133133
* A fast method to retrieve one row of data from the matrix as a BitArray.
134134
*/
135-
public function getRow(int $y, BitArray $row = null) : BitArray
135+
public function getRow(int $y, ?BitArray $row = null) : BitArray
136136
{
137137
if (null === $row || $row->getSize() < $this->width) {
138138
$row = new BitArray($this->width);

src/Common/ReedSolomonCodec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function encode(SplFixedArray $data, SplFixedArray $parity) : void
208208
/**
209209
* Decodes received data.
210210
*/
211-
public function decode(SplFixedArray $data, SplFixedArray $erasures = null) : ?int
211+
public function decode(SplFixedArray $data, ?SplFixedArray $erasures = null) : ?int
212212
{
213213
// This speeds up the initialization a bit.
214214
$numRootsPlusOne = SplFixedArray::fromArray(array_fill(0, $this->numRoots + 1, 0), false);

src/Encoder/Encoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private static function getAlphanumericCode(int $code) : int
160160
/**
161161
* Chooses the best mode for a given content.
162162
*/
163-
private static function chooseMode(string $content, string $encoding = null) : Mode
163+
private static function chooseMode(string $content, ?string $encoding = null) : Mode
164164
{
165165
if (null !== $encoding && 0 === strcasecmp($encoding, 'SHIFT-JIS')) {
166166
return self::isOnlyDoubleByteKanji($content) ? Mode::KANJI() : Mode::BYTE();

0 commit comments

Comments
 (0)