Skip to content

Commit beecbe7

Browse files
committed
:octocat: mark nullable types explicitly (#276)
1 parent 0a897ca commit beecbe7

28 files changed

+48
-48
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@
4242
"require": {
4343
"php": "^7.4 || ^8.0",
4444
"ext-mbstring": "*",
45-
"chillerlan/php-settings-container": "^2.1.4 || ^3.2"
45+
"chillerlan/php-settings-container": "^2.1.6 || ^3.2.1"
4646
},
4747
"require-dev": {
48-
"chillerlan/php-authenticator": "^4.1 || ^5.1",
48+
"chillerlan/php-authenticator": "^4.3.1 || ^5.2.1",
4949
"phan/phan": "^5.4",
5050
"phpunit/phpunit": "^9.6",
5151
"phpmd/phpmd": "^2.15",
5252
"setasign/fpdf": "^1.8.2",
53-
"squizlabs/php_codesniffer": "^3.9"
53+
"squizlabs/php_codesniffer": "^3.10"
5454
},
5555
"suggest": {
5656
"chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps.",

examples/custom_output.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function getDefaultModuleValue(bool $isDark){
4949
/**
5050
* @inheritDoc
5151
*/
52-
public function dump(string $file = null):string{
52+
public function dump(?string $file = null):string{
5353
$output = '';
5454

5555
for($y = 0; $y < $this->moduleCount; $y++){

examples/imageWithLogo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class QRImageWithLogo extends QRGdImagePNG{
3030
* @return string
3131
* @throws \chillerlan\QRCode\Output\QRCodeOutputException
3232
*/
33-
public function dump(string $file = null, string $logo = null):string{
33+
public function dump(?string $file = null, ?string $logo = null):string{
3434
// set returnResource to true to skip further processing for now
3535
$this->options->returnResource = true;
3636

examples/imageWithText.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class QRImageWithText extends QRGdImagePNG{
2626
/**
2727
* @inheritDoc
2828
*/
29-
public function dump(string $file = null, string $text = null):string{
29+
public function dump(?string $file = null, ?string $text = null):string{
3030
// set returnResource to true to skip further processing for now
3131
$this->options->returnResource = true;
3232

examples/imagickConvertSVGtoPNG.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function header():string{
4949
}
5050

5151
/** @inheritDoc */
52-
public function dump(string $file = null):string{
52+
public function dump(?string $file = null):string{
5353
$base64 = $this->options->outputBase64;
5454
// we don't want the SVG in base64
5555
$this->options->outputBase64 = false;

examples/imagickWithLogo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class QRImagickWithLogo extends QRImagick{
2828
* @inheritDoc
2929
* @throws \chillerlan\QRCode\Output\QRCodeOutputException
3030
*/
31-
public function dump(string $file = null):string{
31+
public function dump(?string $file = null):string{
3232
// set returnResource to true to skip further processing for now
3333
$this->options->returnResource = true;
3434

src/Common/GDLuminanceSource.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class GDLuminanceSource extends LuminanceSourceAbstract{
3838
*
3939
* @throws \chillerlan\QRCode\Decoder\QRCodeDecoderException
4040
*/
41-
public function __construct($gdImage, SettingsContainerInterface $options = null){
41+
public function __construct($gdImage, ?SettingsContainerInterface $options = null){
4242

4343
/** @noinspection PhpFullyQualifiedNameUsageInspection */
4444
if(
@@ -85,12 +85,12 @@ protected function setLuminancePixels():void{
8585
}
8686

8787
/** @inheritDoc */
88-
public static function fromFile(string $path, SettingsContainerInterface $options = null):self{
88+
public static function fromFile(string $path, ?SettingsContainerInterface $options = null):self{
8989
return new self(imagecreatefromstring(file_get_contents(self::checkFile($path))), $options);
9090
}
9191

9292
/** @inheritDoc */
93-
public static function fromBlob(string $blob, SettingsContainerInterface $options = null):self{
93+
public static function fromBlob(string $blob, ?SettingsContainerInterface $options = null):self{
9494
return new self(imagecreatefromstring($blob), $options);
9595
}
9696

src/Common/GenericGFPoly.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class GenericGFPoly{
3535
* @throws \chillerlan\QRCode\QRCodeException if argument is null or empty, or if leading coefficient is 0 and this
3636
* is not a constant polynomial (that is, it is not the monomial "0")
3737
*/
38-
public function __construct(array $coefficients, int $degree = null){
38+
public function __construct(array $coefficients, ?int $degree = null){
3939
$degree ??= 0;
4040

4141
if(empty($coefficients)){

src/Common/IMagickLuminanceSource.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class IMagickLuminanceSource extends LuminanceSourceAbstract{
2828
/**
2929
* IMagickLuminanceSource constructor.
3030
*/
31-
public function __construct(Imagick $imagick, SettingsContainerInterface $options = null){
31+
public function __construct(Imagick $imagick, ?SettingsContainerInterface $options = null){
3232
parent::__construct($imagick->getImageWidth(), $imagick->getImageHeight(), $options);
3333

3434
$this->imagick = $imagick;
@@ -63,12 +63,12 @@ protected function setLuminancePixels():void{
6363
}
6464

6565
/** @inheritDoc */
66-
public static function fromFile(string $path, SettingsContainerInterface $options = null):self{
66+
public static function fromFile(string $path, ?SettingsContainerInterface $options = null):self{
6767
return new self(new Imagick(self::checkFile($path)), $options);
6868
}
6969

7070
/** @inheritDoc */
71-
public static function fromBlob(string $blob, SettingsContainerInterface $options = null):self{
71+
public static function fromBlob(string $blob, ?SettingsContainerInterface $options = null):self{
7272
$im = new Imagick;
7373
$im->readImageBlob($blob);
7474

src/Common/LuminanceSourceAbstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class LuminanceSourceAbstract implements LuminanceSourceInterface{
3434
/**
3535
*
3636
*/
37-
public function __construct(int $width, int $height, SettingsContainerInterface $options = null){
37+
public function __construct(int $width, int $height, ?SettingsContainerInterface $options = null){
3838
$this->width = $width;
3939
$this->height = $height;
4040
$this->options = ($options ?? new QROptions);

0 commit comments

Comments
 (0)