Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen van den Enden committed Nov 23, 2018
1 parent 2e1f0be commit 6837ba4
Show file tree
Hide file tree
Showing 25 changed files with 54 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/ErrorCorrectionLevel.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/InvalidPathException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/InvalidWriterException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/MissingExtensionException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/MissingFunctionException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/MissingLogoHeightException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/QrCodeException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/UnsupportedExtensionException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/ValidationException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Factory/QrCodeFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Factory/QrCodeFactoryInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/LabelAlignment.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/QrCode.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/QrCodeInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Response/QrCodeResponse.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Writer/AbstractWriter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Writer/BinaryWriter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Writer/DebugWriter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/Writer/EpsWriter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
3 changes: 3 additions & 0 deletions src/Writer/PngWriter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down Expand Up @@ -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;
}

Expand Down
8 changes: 5 additions & 3 deletions src/Writer/SvgWriter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down Expand Up @@ -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);
Expand All @@ -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';
}

Expand Down
2 changes: 2 additions & 0 deletions src/Writer/WriterInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/WriterRegistry.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions src/WriterRegistryInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down
2 changes: 2 additions & 0 deletions tests/QrCodeTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* (c) Jeroen van den Enden <[email protected]>
*
Expand Down

0 comments on commit 6837ba4

Please sign in to comment.