Skip to content

Commit

Permalink
:octocat: declare strict types
Browse files Browse the repository at this point in the history
  • Loading branch information
codemasher committed Jul 21, 2024
1 parent f32696c commit 7b1d961
Show file tree
Hide file tree
Showing 137 changed files with 144 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/authenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2023 smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\Authenticator\{Authenticator, AuthenticatorOptionsTrait};
use chillerlan\Authenticator\Authenticators\AuthenticatorInterface;
Expand Down
1 change: 1 addition & 0 deletions examples/custom_output.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
* @noinspection PhpIllegalPsrClassPathInspection
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Output\QROutputAbstract;
Expand Down
1 change: 1 addition & 0 deletions examples/eps.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2022 Smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
Expand Down
1 change: 1 addition & 0 deletions examples/fpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @author Maximilian Kresse
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
Expand Down
1 change: 1 addition & 0 deletions examples/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2017 Smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
Expand Down
1 change: 1 addition & 0 deletions examples/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2017 Smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
Expand Down
1 change: 1 addition & 0 deletions examples/imageWithLogo.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
* @noinspection PhpComposerExtensionStubsInspection, PhpIllegalPsrClassPathInspection
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Common\EccLevel;
Expand Down
1 change: 1 addition & 0 deletions examples/imageWithRoundedShapes.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*
* @noinspection PhpComposerExtensionStubsInspection
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Common\EccLevel;
Expand Down
1 change: 1 addition & 0 deletions examples/imageWithText.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
* @noinspection PhpIllegalPsrClassPathInspection, PhpComposerExtensionStubsInspection
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Output\QRGdImagePNG;
Expand Down
1 change: 1 addition & 0 deletions examples/imagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2017 Smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
Expand Down
1 change: 1 addition & 0 deletions examples/imagickConvertSVGtoPNG.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
* @noinspection PhpComposerExtensionStubsInspection
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
Expand Down
1 change: 1 addition & 0 deletions examples/imagickImageAsBackground.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2023 smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QRCodeException, QROptions};
use chillerlan\QRCode\Common\EccLevel;
Expand Down
1 change: 1 addition & 0 deletions examples/imagickWithLogo.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
* @noinspection PhpComposerExtensionStubsInspection
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QRCodeException, QROptions};
use chillerlan\QRCode\Common\EccLevel;
Expand Down
1 change: 1 addition & 0 deletions examples/intervention-image.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2024 smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCode\Output\QRInterventionImage;
Expand Down
1 change: 1 addition & 0 deletions examples/multimode.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2023 smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};

Expand Down
1 change: 1 addition & 0 deletions examples/qrcode-interactive.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* @noinspection PhpComposerExtensionStubsInspection
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
Expand Down
1 change: 1 addition & 0 deletions examples/reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2022 smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};

Expand Down
1 change: 1 addition & 0 deletions examples/reflectance.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2023 smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Common\EccLevel;
Expand Down
1 change: 1 addition & 0 deletions examples/svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
* @noinspection PhpComposerExtensionStubsInspection
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
Expand Down
1 change: 1 addition & 0 deletions examples/svgConvertViaCanvas.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2023 smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
Expand Down
1 change: 1 addition & 0 deletions examples/svgMeltedModules.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @see https://github.com/chillerlan/php-qrcode/issues/127
* @see ./shapes.svg
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Common\EccLevel;
Expand Down
1 change: 1 addition & 0 deletions examples/svgRandomColoredDots.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
* @noinspection PhpIllegalPsrClassPathInspection
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Common\EccLevel;
Expand Down
1 change: 1 addition & 0 deletions examples/svgRoundQuietzone.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
* @noinspection PhpIllegalPsrClassPathInspection
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QRCodeException, QROptions};
use chillerlan\QRCode\Common\EccLevel;
Expand Down
1 change: 1 addition & 0 deletions examples/svgWithLogo.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
* @noinspection PhpComposerExtensionStubsInspection
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QRCodeException, QROptions};
use chillerlan\QRCode\Common\EccLevel;
Expand Down
1 change: 1 addition & 0 deletions examples/svgWithLogoAndCustomShapes.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
* @noinspection PhpComposerExtensionStubsInspection
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QRCodeException, QROptions};
use chillerlan\QRCode\Common\EccLevel;
Expand Down
1 change: 1 addition & 0 deletions examples/text.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2017 Smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
Expand Down
1 change: 1 addition & 0 deletions examples/xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2024 smiley
* @license MIT
*/
declare(strict_types=1);

use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCode\{QRCode, QROptions};
Expand Down
10 changes: 8 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@

<rule ref="SlevomatCodingStandard.Strings.DisallowVariableParsing"/>

<!--<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/>-->
<!--<rule ref="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint"/>-->
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition"/>
Expand All @@ -87,6 +86,13 @@
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable"/>
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>

<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="linesCountBeforeDeclare" value="0"/>
<property name="linesCountAfterDeclare" value="1"/>
<property name="spacesCountAroundEqualsSign" value="0"/>
</properties>
</rule>

<rule ref="SlevomatCodingStandard.Functions.RequireMultiLineCall">
<properties>
Expand Down Expand Up @@ -147,7 +153,7 @@
<rule ref="Generic.PHP.LowerCaseKeyword"/>
<rule ref="Generic.PHP.LowerCaseType"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
<!--<rule ref="Generic.PHP.RequireStrictTypes"/>-->
<rule ref="Generic.PHP.RequireStrictTypes"/>
<rule ref="Generic.PHP.SAPIUsage"/>
<rule ref="Generic.PHP.Syntax"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
Expand Down
1 change: 1 addition & 0 deletions src/Common/BitBuffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2015 Smiley
* @license MIT
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Common;

Expand Down
1 change: 1 addition & 0 deletions src/Common/ECICharset.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @copyright 2021 smiley
* @license Apache-2.0
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Common;

Expand Down
1 change: 1 addition & 0 deletions src/Common/EccLevel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2020 smiley
* @license MIT
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Common;

Expand Down
1 change: 1 addition & 0 deletions src/Common/GDLuminanceSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*
* @noinspection PhpComposerExtensionStubsInspection
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Common;

Expand Down
1 change: 1 addition & 0 deletions src/Common/GF256.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @copyright 2021 Smiley
* @license Apache-2.0
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Common;

Expand Down
1 change: 1 addition & 0 deletions src/Common/GenericGFPoly.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @copyright 2021 Smiley
* @license Apache-2.0
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Common;

Expand Down
1 change: 1 addition & 0 deletions src/Common/IMagickLuminanceSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*
* @noinspection PhpComposerExtensionStubsInspection
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Common;

Expand Down
1 change: 1 addition & 0 deletions src/Common/LuminanceSourceAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @copyright 2021 Smiley
* @license Apache-2.0
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Common;

Expand Down
1 change: 1 addition & 0 deletions src/Common/LuminanceSourceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2021 smiley
* @license MIT
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Common;

Expand Down
1 change: 1 addition & 0 deletions src/Common/MaskPattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @copyright 2021 Smiley
* @license Apache-2.0
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Common;

Expand Down
1 change: 1 addition & 0 deletions src/Common/Mode.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2020 smiley
* @license MIT
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Common;

Expand Down
1 change: 1 addition & 0 deletions src/Common/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2020 smiley
* @license MIT
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Common;

Expand Down
1 change: 1 addition & 0 deletions src/Data/AlphaNum.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2015 Smiley
* @license MIT
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Data;

Expand Down
1 change: 1 addition & 0 deletions src/Data/Byte.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2015 Smiley
* @license MIT
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Data;

Expand Down
1 change: 1 addition & 0 deletions src/Data/ECI.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2020 smiley
* @license MIT
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Data;

Expand Down
1 change: 1 addition & 0 deletions src/Data/Hanzi.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2020 smiley
* @license MIT
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Data;

Expand Down
1 change: 1 addition & 0 deletions src/Data/Kanji.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2015 Smiley
* @license MIT
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Data;

Expand Down
1 change: 1 addition & 0 deletions src/Data/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2015 Smiley
* @license MIT
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Data;

Expand Down
1 change: 1 addition & 0 deletions src/Data/QRCodeDataException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @copyright 2015 Smiley
* @license MIT
*/
declare(strict_types=1);

namespace chillerlan\QRCode\Data;

Expand Down
Loading

0 comments on commit 7b1d961

Please sign in to comment.