Skip to content

Commit

Permalink
Fix implicitly nullable params
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-tekiela committed Mar 21, 2024
1 parent c01758c commit 4197cee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Common/BitMatrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class BitMatrix
/**
* @throws InvalidArgumentException if a dimension is smaller than zero
*/
public function __construct(int $width, int $height = null)
public function __construct(int $width, ?int $height = null)
{
if (null === $height) {
$height = $width;
Expand Down Expand Up @@ -132,7 +132,7 @@ public function setRegion(int $left, int $top, int $width, int $height) : void
/**
* A fast method to retrieve one row of data from the matrix as a BitArray.
*/
public function getRow(int $y, BitArray $row = null) : BitArray
public function getRow(int $y, ?BitArray $row = null) : BitArray
{
if (null === $row || $row->getSize() < $this->width) {
$row = new BitArray($this->width);
Expand Down
2 changes: 1 addition & 1 deletion src/Common/ReedSolomonCodec.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function encode(SplFixedArray $data, SplFixedArray $parity) : void
/**
* Decodes received data.
*/
public function decode(SplFixedArray $data, SplFixedArray $erasures = null) : ?int
public function decode(SplFixedArray $data, ?SplFixedArray $erasures = null) : ?int
{
// This speeds up the initialization a bit.
$numRootsPlusOne = SplFixedArray::fromArray(array_fill(0, $this->numRoots + 1, 0), false);
Expand Down
2 changes: 1 addition & 1 deletion src/Encoder/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private static function getAlphanumericCode(int $code) : int
/**
* Chooses the best mode for a given content.
*/
private static function chooseMode(string $content, string $encoding = null) : Mode
private static function chooseMode(string $content, ?string $encoding = null) : Mode
{
if (null !== $encoding && 0 === strcasecmp($encoding, 'SHIFT-JIS')) {
return self::isOnlyDoubleByteKanji($content) ? Mode::KANJI() : Mode::BYTE();
Expand Down

0 comments on commit 4197cee

Please sign in to comment.