Skip to content

Commit 7b1d961

Browse files
committed
:octocat: declare strict types
1 parent f32696c commit 7b1d961

File tree

137 files changed

+144
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+144
-2
lines changed

examples/authenticator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2023 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\Authenticator\{Authenticator, AuthenticatorOptionsTrait};
1213
use chillerlan\Authenticator\Authenticators\AuthenticatorInterface;

examples/custom_output.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*
1010
* @noinspection PhpIllegalPsrClassPathInspection
1111
*/
12+
declare(strict_types=1);
1213

1314
use chillerlan\QRCode\{QRCode, QROptions};
1415
use chillerlan\QRCode\Output\QROutputAbstract;

examples/eps.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2022 Smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\{QRCode, QROptions};
1213
use chillerlan\QRCode\Data\QRMatrix;

examples/fpdf.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* @author Maximilian Kresse
77
* @license MIT
88
*/
9+
declare(strict_types=1);
910

1011
use chillerlan\QRCode\{QRCode, QROptions};
1112
use chillerlan\QRCode\Data\QRMatrix;

examples/html.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2017 Smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\{QRCode, QROptions};
1213
use chillerlan\QRCode\Data\QRMatrix;

examples/image.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2017 Smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\{QRCode, QROptions};
1213
use chillerlan\QRCode\Data\QRMatrix;

examples/imageWithLogo.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*
1010
* @noinspection PhpComposerExtensionStubsInspection, PhpIllegalPsrClassPathInspection
1111
*/
12+
declare(strict_types=1);
1213

1314
use chillerlan\QRCode\{QRCode, QROptions};
1415
use chillerlan\QRCode\Common\EccLevel;

examples/imageWithRoundedShapes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*
1313
* @noinspection PhpComposerExtensionStubsInspection
1414
*/
15+
declare(strict_types=1);
1516

1617
use chillerlan\QRCode\{QRCode, QROptions};
1718
use chillerlan\QRCode\Common\EccLevel;

examples/imageWithText.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*
1212
* @noinspection PhpIllegalPsrClassPathInspection, PhpComposerExtensionStubsInspection
1313
*/
14+
declare(strict_types=1);
1415

1516
use chillerlan\QRCode\{QRCode, QROptions};
1617
use chillerlan\QRCode\Output\QRGdImagePNG;

examples/imagick.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2017 Smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\{QRCode, QROptions};
1213
use chillerlan\QRCode\Data\QRMatrix;

examples/imagickConvertSVGtoPNG.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*
1818
* @noinspection PhpComposerExtensionStubsInspection
1919
*/
20+
declare(strict_types=1);
2021

2122
use chillerlan\QRCode\{QRCode, QROptions};
2223
use chillerlan\QRCode\Data\QRMatrix;

examples/imagickImageAsBackground.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2023 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\{QRCode, QRCodeException, QROptions};
1213
use chillerlan\QRCode\Common\EccLevel;

examples/imagickWithLogo.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*
1010
* @noinspection PhpComposerExtensionStubsInspection
1111
*/
12+
declare(strict_types=1);
1213

1314
use chillerlan\QRCode\{QRCode, QRCodeException, QROptions};
1415
use chillerlan\QRCode\Common\EccLevel;

examples/intervention-image.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2024 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\Data\QRMatrix;
1213
use chillerlan\QRCode\Output\QRInterventionImage;

examples/multimode.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2023 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\{QRCode, QROptions};
1213

examples/qrcode-interactive.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*
88
* @noinspection PhpComposerExtensionStubsInspection
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\{QRCode, QROptions};
1213
use chillerlan\QRCode\Data\QRMatrix;

examples/reader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2022 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\{QRCode, QROptions};
1213

examples/reflectance.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2023 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\{QRCode, QROptions};
1213
use chillerlan\QRCode\Common\EccLevel;

examples/svg.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*
1010
* @noinspection PhpComposerExtensionStubsInspection
1111
*/
12+
declare(strict_types=1);
1213

1314
use chillerlan\QRCode\{QRCode, QROptions};
1415
use chillerlan\QRCode\Data\QRMatrix;

examples/svgConvertViaCanvas.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2023 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\{QRCode, QROptions};
1213
use chillerlan\QRCode\Data\QRMatrix;

examples/svgMeltedModules.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @see https://github.com/chillerlan/php-qrcode/issues/127
1010
* @see ./shapes.svg
1111
*/
12+
declare(strict_types=1);
1213

1314
use chillerlan\QRCode\{QRCode, QROptions};
1415
use chillerlan\QRCode\Common\EccLevel;

examples/svgRandomColoredDots.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*
1212
* @noinspection PhpIllegalPsrClassPathInspection
1313
*/
14+
declare(strict_types=1);
1415

1516
use chillerlan\QRCode\{QRCode, QROptions};
1617
use chillerlan\QRCode\Common\EccLevel;

examples/svgRoundQuietzone.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*
1212
* @noinspection PhpIllegalPsrClassPathInspection
1313
*/
14+
declare(strict_types=1);
1415

1516
use chillerlan\QRCode\{QRCode, QRCodeException, QROptions};
1617
use chillerlan\QRCode\Common\EccLevel;

examples/svgWithLogo.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*
1010
* @noinspection PhpComposerExtensionStubsInspection
1111
*/
12+
declare(strict_types=1);
1213

1314
use chillerlan\QRCode\{QRCode, QRCodeException, QROptions};
1415
use chillerlan\QRCode\Common\EccLevel;

examples/svgWithLogoAndCustomShapes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*
1212
* @noinspection PhpComposerExtensionStubsInspection
1313
*/
14+
declare(strict_types=1);
1415

1516
use chillerlan\QRCode\{QRCode, QRCodeException, QROptions};
1617
use chillerlan\QRCode\Common\EccLevel;

examples/text.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2017 Smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\{QRCode, QROptions};
1213
use chillerlan\QRCode\Data\QRMatrix;

examples/xml.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2024 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
use chillerlan\QRCode\Data\QRMatrix;
1213
use chillerlan\QRCode\{QRCode, QROptions};

phpcs.xml.dist

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474

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

77-
<!--<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/>-->
7877
<!--<rule ref="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint"/>-->
7978
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
8079
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition"/>
@@ -87,6 +86,13 @@
8786
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable"/>
8887
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
8988

89+
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
90+
<properties>
91+
<property name="linesCountBeforeDeclare" value="0"/>
92+
<property name="linesCountAfterDeclare" value="1"/>
93+
<property name="spacesCountAroundEqualsSign" value="0"/>
94+
</properties>
95+
</rule>
9096

9197
<rule ref="SlevomatCodingStandard.Functions.RequireMultiLineCall">
9298
<properties>
@@ -147,7 +153,7 @@
147153
<rule ref="Generic.PHP.LowerCaseKeyword"/>
148154
<rule ref="Generic.PHP.LowerCaseType"/>
149155
<rule ref="Generic.PHP.NoSilencedErrors"/>
150-
<!--<rule ref="Generic.PHP.RequireStrictTypes"/>-->
156+
<rule ref="Generic.PHP.RequireStrictTypes"/>
151157
<rule ref="Generic.PHP.SAPIUsage"/>
152158
<rule ref="Generic.PHP.Syntax"/>
153159
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>

src/Common/BitBuffer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2015 Smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
namespace chillerlan\QRCode\Common;
1213

src/Common/ECICharset.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @copyright 2021 smiley
99
* @license Apache-2.0
1010
*/
11+
declare(strict_types=1);
1112

1213
namespace chillerlan\QRCode\Common;
1314

src/Common/EccLevel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2020 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
namespace chillerlan\QRCode\Common;
1213

src/Common/GDLuminanceSource.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*
1111
* @noinspection PhpComposerExtensionStubsInspection
1212
*/
13+
declare(strict_types=1);
1314

1415
namespace chillerlan\QRCode\Common;
1516

src/Common/GF256.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @copyright 2021 Smiley
99
* @license Apache-2.0
1010
*/
11+
declare(strict_types=1);
1112

1213
namespace chillerlan\QRCode\Common;
1314

src/Common/GenericGFPoly.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @copyright 2021 Smiley
99
* @license Apache-2.0
1010
*/
11+
declare(strict_types=1);
1112

1213
namespace chillerlan\QRCode\Common;
1314

src/Common/IMagickLuminanceSource.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*
1111
* @noinspection PhpComposerExtensionStubsInspection
1212
*/
13+
declare(strict_types=1);
1314

1415
namespace chillerlan\QRCode\Common;
1516

src/Common/LuminanceSourceAbstract.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @copyright 2021 Smiley
1010
* @license Apache-2.0
1111
*/
12+
declare(strict_types=1);
1213

1314
namespace chillerlan\QRCode\Common;
1415

src/Common/LuminanceSourceInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2021 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
namespace chillerlan\QRCode\Common;
1213

src/Common/MaskPattern.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @copyright 2021 Smiley
99
* @license Apache-2.0
1010
*/
11+
declare(strict_types=1);
1112

1213
namespace chillerlan\QRCode\Common;
1314

src/Common/Mode.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2020 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
namespace chillerlan\QRCode\Common;
1213

src/Common/Version.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2020 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
namespace chillerlan\QRCode\Common;
1213

src/Data/AlphaNum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2015 Smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
namespace chillerlan\QRCode\Data;
1213

src/Data/Byte.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2015 Smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
namespace chillerlan\QRCode\Data;
1213

src/Data/ECI.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2020 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
namespace chillerlan\QRCode\Data;
1213

src/Data/Hanzi.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2020 smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
namespace chillerlan\QRCode\Data;
1213

src/Data/Kanji.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2015 Smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
namespace chillerlan\QRCode\Data;
1213

src/Data/Number.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2015 Smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
namespace chillerlan\QRCode\Data;
1213

src/Data/QRCodeDataException.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @copyright 2015 Smiley
88
* @license MIT
99
*/
10+
declare(strict_types=1);
1011

1112
namespace chillerlan\QRCode\Data;
1213

0 commit comments

Comments
 (0)