diff --git a/.phan/stubs/misc.php b/.phan/stubs/misc.php new file mode 100644 index 000000000..344626701 --- /dev/null +++ b/.phan/stubs/misc.php @@ -0,0 +1,11 @@ + + * @copyright 2021 smiley + * @license MIT + */ + +class GdImage{} diff --git a/src/Decoder/GDLuminanceSource.php b/src/Decoder/GDLuminanceSource.php index 787d3cb35..e0a787c4c 100644 --- a/src/Decoder/GDLuminanceSource.php +++ b/src/Decoder/GDLuminanceSource.php @@ -25,7 +25,6 @@ final class GDLuminanceSource extends LuminanceSource{ /** * @var resource|\GdImage - * @phan-suppress PhanUndeclaredTypeProperty */ private $gdImage; @@ -33,15 +32,13 @@ final class GDLuminanceSource extends LuminanceSource{ * GDLuminanceSource constructor. * * @param resource|\GdImage $gdImage - * @phan-suppress PhanUndeclaredTypeParameter * * @throws \InvalidArgumentException */ public function __construct($gdImage){ - /** @noinspection PhpElementIsNotAvailableInCurrentPhpVersionInspection, PhpFullyQualifiedNameUsageInspection */ + /** @noinspection PhpFullyQualifiedNameUsageInspection */ if( - /** @phan-suppress-next-line PhanUndeclaredClassInstanceof */ (PHP_MAJOR_VERSION >= 8 && !$gdImage instanceof \GdImage) || (PHP_MAJOR_VERSION < 8 && (!is_resource($gdImage) || get_resource_type($gdImage) !== 'gd')) ){ diff --git a/src/Output/QRImage.php b/src/Output/QRImage.php index 177ad50e5..391235dcf 100644 --- a/src/Output/QRImage.php +++ b/src/Output/QRImage.php @@ -45,8 +45,6 @@ class QRImage extends QROutputAbstract{ * * @see imagecreatetruecolor() * @var resource|\GdImage - * - * @phan-suppress PhanUndeclaredTypeProperty */ protected $image; diff --git a/src/QRCodeReader.php b/src/QRCodeReader.php index f0c24d64b..6a88b9d0a 100644 --- a/src/QRCodeReader.php +++ b/src/QRCodeReader.php @@ -29,7 +29,6 @@ final class QRCodeReader{ * @param \Imagick|\GdImage|resource $im * * @return \chillerlan\QRCode\Decoder\DecoderResult - * @phan-suppress PhanUndeclaredTypeParameter (GdImage) */ protected function decode($im):DecoderResult{ @@ -78,7 +77,6 @@ final class QRCodeReader{ /** * @param \Imagick|\GdImage|resource $imgSource - * @phan-suppress PhanUndeclaredTypeParameter * * @return \chillerlan\QRCode\Decoder\DecoderResult */ diff --git a/tests/Output/QRImageTest.php b/tests/Output/QRImageTest.php index f7e163683..ff6e1bb36 100644 --- a/tests/Output/QRImageTest.php +++ b/tests/Output/QRImageTest.php @@ -70,7 +70,7 @@ class QRImageTest extends QROutputTestAbstract{ } /** - * @phan-suppress PhanUndeclaredClassReference + * */ public function testOutputGetResource():void{ $this->options->returnResource = true; @@ -78,7 +78,7 @@ class QRImageTest extends QROutputTestAbstract{ $actual = $this->outputInterface->dump(); - /** @noinspection PhpElementIsNotAvailableInCurrentPhpVersionInspection */ + /** @noinspection PhpFullyQualifiedNameUsageInspection */ \PHP_MAJOR_VERSION >= 8 ? $this::assertInstanceOf(\GdImage::class, $actual) : $this::assertIsResource($actual);