Skip to content

Commit 3db66b0

Browse files
authored
Merge pull request #404 from thephpleague/chore/strict-types
Use strict typing
2 parents 26af6ff + 116b8cb commit 3db66b0

Some content is hidden

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

60 files changed

+118
-1
lines changed

.github/workflows/test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858

5959
- name: php-cs-fixer
6060
run: |
61-
vendor/bin/php-cs-fixer fix --dry-run --diff
61+
vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes
6262
6363
static-analysis:
6464
runs-on: ubuntu-24.04

.php-cs-fixer.dist.php

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
return (new PhpCsFixer\Config())
99
->setRules([
1010
'@Symfony' => true,
11+
'declare_strict_types' => true,
1112
'phpdoc_annotation_without_dot' => false,
1213
'nullable_type_declaration_for_default_null_value' => [
1314
'use_nullable_type_declaration' => true,

src/Api/Api.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Api;
46

57
use Intervention\Image\Decoders\BinaryImageDecoder;

src/Api/ApiInterface.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Api;
46

57
interface ApiInterface

src/Api/Encoder.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Api;
46

57
use Intervention\Image\Interfaces\EncodedImageInterface;

src/Filesystem/FileNotFoundException.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Filesystem;
46

57
class FileNotFoundException extends \Exception

src/Filesystem/FilesystemException.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Filesystem;
46

57
class FilesystemException extends \Exception

src/Manipulators/Background.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/BaseManipulator.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/Blur.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/Border.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Geometry\Factories\RectangleFactory;

src/Manipulators/Brightness.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/Contrast.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/Crop.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/Filter.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/Flip.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/Gamma.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/Helpers/Color.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators\Helpers;
46

57
class Color

src/Manipulators/Helpers/Dimension.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators\Helpers;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/ManipulatorInterface.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/Orientation.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/Pixelate.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/Sharpen.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Manipulators/Size.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Geometry\Rectangle;

src/Manipulators/Watermark.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

src/Responses/PsrResponseFactory.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Responses;
46

57
use League\Flysystem\FilesystemOperator;

src/Responses/ResponseFactoryInterface.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Responses;
46

57
use League\Flysystem\FilesystemOperator;

src/Server.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide;
46

57
use League\Flysystem\FilesystemException as FilesystemV2Exception;

src/ServerFactory.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide;
46

57
use Intervention\Image\ImageManager;

src/Signatures/Signature.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Signatures;
46

57
class Signature implements SignatureInterface

src/Signatures/SignatureException.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Signatures;
46

57
class SignatureException extends \Exception

src/Signatures/SignatureFactory.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Signatures;
46

57
class SignatureFactory

src/Signatures/SignatureInterface.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Signatures;
46

57
interface SignatureInterface

src/Urls/UrlBuilder.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Urls;
46

57
use League\Glide\Signatures\SignatureInterface;

src/Urls/UrlBuilderFactory.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Urls;
46

57
use League\Glide\Signatures\SignatureFactory;

tests/Api/ApiTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Api;
46

57
use Intervention\Image\ImageManager;

tests/Api/EncoderTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Api;
46

57
use Intervention\Image\Encoders\MediaTypeEncoder;

tests/Manipulators/BackgroundTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\DriverInterface;

tests/Manipulators/BlurTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

tests/Manipulators/BorderTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Geometry\Factories\RectangleFactory;

tests/Manipulators/BrightnessTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

tests/Manipulators/ContrastTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

tests/Manipulators/CropTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

tests/Manipulators/FilterTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

tests/Manipulators/FlipTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

tests/Manipulators/GammaTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

tests/Manipulators/Helpers/ColorTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators\Helpers;
46

57
use PHPUnit\Framework\TestCase;

tests/Manipulators/Helpers/DimensionTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators\Helpers;
46

57
use Intervention\Image\Interfaces\ImageInterface;

tests/Manipulators/OrientationTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Glide\Manipulators;
46

57
use Intervention\Image\Interfaces\ImageInterface;

0 commit comments

Comments
 (0)