🔥 v6.0 first pass: PHP 8.2, remove deprecated elements, add type hints

This commit is contained in:
smiley
2023-11-25 12:49:56 +01:00
parent a301af5b7f
commit 39e3dfe83b
80 changed files with 332 additions and 1029 deletions
+16 -112
View File
@@ -18,116 +18,24 @@ use chillerlan\QRCode\Data\QRMatrix;
interface QROutputInterface{
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const MARKUP_HTML = 'html';
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const MARKUP_SVG = 'svg';
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const GDIMAGE_BMP = 'bmp';
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const GDIMAGE_GIF = 'gif';
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const GDIMAGE_JPG = 'jpg';
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const GDIMAGE_PNG = 'png';
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const GDIMAGE_WEBP = 'webp';
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const STRING_JSON = 'json';
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const STRING_TEXT = 'text';
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const IMAGICK = 'imagick';
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const FPDF = 'fpdf';
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const EPS = 'eps';
/**
* @var string
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const CUSTOM = 'custom';
/**
* Map of built-in output modes => class FQN
* Map of built-in output class FQN
*
* @var string[]
* @deprecated 5.0.0 <no replacement>
* @see https://github.com/chillerlan/php-qrcode/issues/223
* @see https://github.com/chillerlan/php-qrcode/issues/223
*/
public const MODES = [
self::MARKUP_SVG => QRMarkupSVG::class,
self::MARKUP_HTML => QRMarkupHTML::class,
self::GDIMAGE_BMP => QRGdImageBMP::class,
self::GDIMAGE_GIF => QRGdImageGIF::class,
self::GDIMAGE_JPG => QRGdImageJPEG::class,
self::GDIMAGE_PNG => QRGdImagePNG::class,
self::GDIMAGE_WEBP => QRGdImageWEBP::class,
self::STRING_JSON => QRStringJSON::class,
self::STRING_TEXT => QRStringText::class,
self::IMAGICK => QRImagick::class,
self::FPDF => QRFpdf::class,
self::EPS => QREps::class,
QRMarkupSVG::class,
QRMarkupHTML::class,
QRGdImageBMP::class,
QRGdImageGIF::class,
QRGdImageJPEG::class,
QRGdImagePNG::class,
QRGdImageWEBP::class,
QRStringJSON::class,
QRStringText::class,
QRImagick::class,
QRFpdf::class,
QREps::class,
];
/**
@@ -205,10 +113,8 @@ interface QROutputInterface{
/**
* Determines whether the given value is valid
*
* @param mixed $value
*/
public static function moduleValueIsValid($value):bool;
public static function moduleValueIsValid(mixed $value):bool;
/**
* Generates the output, optionally dumps it to a file, and returns it
@@ -218,9 +124,7 @@ interface QROutputInterface{
* you need to supply the $file parameter here in that case (or handle the option value in your custom output module).
*
* @see \chillerlan\QRCode\QRCode::renderMatrix()
*
* @return mixed
*/
public function dump(string $file = null);
public function dump(string $file = null):mixed;
}