mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-18 15:52:28 +00:00
:octocat: fix PHPCS config, add Slevomat rules
This commit is contained in:
@@ -24,13 +24,11 @@ require_once __DIR__.'/../vendor/autoload.php';
|
||||
class QRImageWithLogo extends QRGdImagePNG{
|
||||
|
||||
/**
|
||||
* @param string|null $file
|
||||
* @param string|null $logo
|
||||
*
|
||||
* @return string
|
||||
* @throws \chillerlan\QRCode\Output\QRCodeOutputException
|
||||
*/
|
||||
public function dump(string|null $file = null, string|null $logo = null):string{
|
||||
$logo ??= '';
|
||||
|
||||
// set returnResource to true to skip further processing for now
|
||||
$this->options->returnResource = true;
|
||||
|
||||
@@ -45,6 +43,10 @@ class QRImageWithLogo extends QRGdImagePNG{
|
||||
|
||||
$im = imagecreatefrompng($logo);
|
||||
|
||||
if($im === false){
|
||||
throw new QRCodeOutputException('imagecreatefrompng() error');
|
||||
}
|
||||
|
||||
// get logo image size
|
||||
$w = imagesx($im);
|
||||
$h = imagesy($im);
|
||||
|
||||
Reference in New Issue
Block a user