diff --git a/src/ErrorCorrectionLevel.php b/src/ErrorCorrectionLevel.php index 4a963f3..b75c216 100644 --- a/src/ErrorCorrectionLevel.php +++ b/src/ErrorCorrectionLevel.php @@ -1,5 +1,7 @@ * diff --git a/src/Exception/InvalidPathException.php b/src/Exception/InvalidPathException.php index 6492b54..987de08 100644 --- a/src/Exception/InvalidPathException.php +++ b/src/Exception/InvalidPathException.php @@ -1,5 +1,7 @@ * diff --git a/src/Exception/InvalidWriterException.php b/src/Exception/InvalidWriterException.php index 4663403..62a609f 100644 --- a/src/Exception/InvalidWriterException.php +++ b/src/Exception/InvalidWriterException.php @@ -1,5 +1,7 @@ * diff --git a/src/Exception/MissingExtensionException.php b/src/Exception/MissingExtensionException.php index e364968..d9ea2c7 100644 --- a/src/Exception/MissingExtensionException.php +++ b/src/Exception/MissingExtensionException.php @@ -1,5 +1,7 @@ * diff --git a/src/Exception/MissingFunctionException.php b/src/Exception/MissingFunctionException.php index 9afe997..667dbbd 100644 --- a/src/Exception/MissingFunctionException.php +++ b/src/Exception/MissingFunctionException.php @@ -1,5 +1,7 @@ * diff --git a/src/Exception/MissingLogoHeightException.php b/src/Exception/MissingLogoHeightException.php index 97c76a0..fcd66bc 100644 --- a/src/Exception/MissingLogoHeightException.php +++ b/src/Exception/MissingLogoHeightException.php @@ -1,5 +1,7 @@ * diff --git a/src/Exception/QrCodeException.php b/src/Exception/QrCodeException.php index f076a95..74e6139 100644 --- a/src/Exception/QrCodeException.php +++ b/src/Exception/QrCodeException.php @@ -1,5 +1,7 @@ * diff --git a/src/Exception/UnsupportedExtensionException.php b/src/Exception/UnsupportedExtensionException.php index 4b1c6f2..520e491 100644 --- a/src/Exception/UnsupportedExtensionException.php +++ b/src/Exception/UnsupportedExtensionException.php @@ -1,5 +1,7 @@ * diff --git a/src/Exception/ValidationException.php b/src/Exception/ValidationException.php index 85d8380..4f6a227 100644 --- a/src/Exception/ValidationException.php +++ b/src/Exception/ValidationException.php @@ -1,5 +1,7 @@ * diff --git a/src/Factory/QrCodeFactory.php b/src/Factory/QrCodeFactory.php index 9d4b557..b7079f4 100644 --- a/src/Factory/QrCodeFactory.php +++ b/src/Factory/QrCodeFactory.php @@ -1,5 +1,7 @@ * diff --git a/src/Factory/QrCodeFactoryInterface.php b/src/Factory/QrCodeFactoryInterface.php index 18aa8fb..2953fd6 100644 --- a/src/Factory/QrCodeFactoryInterface.php +++ b/src/Factory/QrCodeFactoryInterface.php @@ -1,5 +1,7 @@ * diff --git a/src/LabelAlignment.php b/src/LabelAlignment.php index ac30cc9..f96acc5 100644 --- a/src/LabelAlignment.php +++ b/src/LabelAlignment.php @@ -1,5 +1,7 @@ * diff --git a/src/QrCode.php b/src/QrCode.php index 164ce05..0b32cb3 100644 --- a/src/QrCode.php +++ b/src/QrCode.php @@ -1,5 +1,7 @@ * diff --git a/src/QrCodeInterface.php b/src/QrCodeInterface.php index 68e74b4..bb1d78f 100644 --- a/src/QrCodeInterface.php +++ b/src/QrCodeInterface.php @@ -1,5 +1,7 @@ * diff --git a/src/Response/QrCodeResponse.php b/src/Response/QrCodeResponse.php index 3b2cc0e..8540998 100644 --- a/src/Response/QrCodeResponse.php +++ b/src/Response/QrCodeResponse.php @@ -1,5 +1,7 @@ * diff --git a/src/Writer/AbstractWriter.php b/src/Writer/AbstractWriter.php index 164cf90..ed1cecb 100644 --- a/src/Writer/AbstractWriter.php +++ b/src/Writer/AbstractWriter.php @@ -1,5 +1,7 @@ * diff --git a/src/Writer/BinaryWriter.php b/src/Writer/BinaryWriter.php index b8d1d7b..0ab61dc 100644 --- a/src/Writer/BinaryWriter.php +++ b/src/Writer/BinaryWriter.php @@ -1,5 +1,7 @@ * diff --git a/src/Writer/DebugWriter.php b/src/Writer/DebugWriter.php index 11d3865..9e5f097 100644 --- a/src/Writer/DebugWriter.php +++ b/src/Writer/DebugWriter.php @@ -1,5 +1,7 @@ * diff --git a/src/Writer/EpsWriter.php b/src/Writer/EpsWriter.php index 0e9d97c..a97d86f 100644 --- a/src/Writer/EpsWriter.php +++ b/src/Writer/EpsWriter.php @@ -1,5 +1,7 @@ * diff --git a/src/Writer/PngWriter.php b/src/Writer/PngWriter.php index e076518..85ae892 100644 --- a/src/Writer/PngWriter.php +++ b/src/Writer/PngWriter.php @@ -1,5 +1,7 @@ * @@ -81,6 +83,7 @@ private function createInterpolatedImage($baseImage, array $data, QrCodeInterfac imagefill($image, 0, 0, $backgroundColor); imagecopyresampled($image, $baseImage, $data['margin_left'], $data['margin_left'], 0, 0, $data['inner_width'], $data['inner_height'], imagesx($baseImage), imagesy($baseImage)); imagesavealpha($image, true); + return $image; } diff --git a/src/Writer/SvgWriter.php b/src/Writer/SvgWriter.php index 6a96c22..ba6d42f 100644 --- a/src/Writer/SvgWriter.php +++ b/src/Writer/SvgWriter.php @@ -1,5 +1,7 @@ * @@ -79,8 +81,8 @@ private function addLogo(SimpleXMLElement $svg, int $imageWidth, int $imageHeigh $mimeType = $this->getMimeType($logoPath); $imageData = file_get_contents($logoPath); - if ($logoHeight === null) { - if ($mimeType === 'image/svg+xml') { + if (null === $logoHeight) { + if ('image/svg+xml' === $mimeType) { throw new MissingLogoHeightException('SVG Logos require an explicit height set via setLogoSize($width, $height)'); } else { $logoImage = imagecreatefromstring($imageData); @@ -107,7 +109,7 @@ private function getMimeType(string $path): string $mimeType = mime_content_type($path); // Passing mime type image/svg results in invisible images - if ($mimeType === 'image/svg') { + if ('image/svg' === $mimeType) { return 'image/svg+xml'; } diff --git a/src/Writer/WriterInterface.php b/src/Writer/WriterInterface.php index df0a4d1..6bd462d 100644 --- a/src/Writer/WriterInterface.php +++ b/src/Writer/WriterInterface.php @@ -1,5 +1,7 @@ * diff --git a/src/WriterRegistry.php b/src/WriterRegistry.php index 09a6ac6..0755ad4 100644 --- a/src/WriterRegistry.php +++ b/src/WriterRegistry.php @@ -1,5 +1,7 @@ * diff --git a/src/WriterRegistryInterface.php b/src/WriterRegistryInterface.php index 38181ff..5a22d51 100644 --- a/src/WriterRegistryInterface.php +++ b/src/WriterRegistryInterface.php @@ -1,5 +1,7 @@ * diff --git a/tests/QrCodeTest.php b/tests/QrCodeTest.php index 14df313..fd24f56 100755 --- a/tests/QrCodeTest.php +++ b/tests/QrCodeTest.php @@ -1,5 +1,7 @@ *