-
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init phpstan * fix first set of issues * add todo for missing use case * explicitly transform floats to int * imagepng() expects quality param to be an integer between 0 and 9 * method returns float, variable where stored is also typed as float * define array structures * add more array type hints * change interface params to match the actual implementations * Fix styling * add phpstan workflow * change missing types to int|float * Fix styling * move exif stuff to baseline * replace intval() with (int) (int) is consider the best practice as it is up to 6x faster * Fix styling * int/float fixes * Fix styling --------- Co-authored-by: Nielsvanpach <Nielsvanpach@users.noreply.github.com>
- Loading branch information
1 parent
d239296
commit db37120
Showing
18 changed files
with
195 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: PHPStan | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**.php' | ||
- 'phpstan.neon.dist' | ||
- '.github/workflows/phpstan.yml' | ||
|
||
jobs: | ||
phpstan: | ||
name: phpstan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
coverage: none | ||
tools: phpstan | ||
|
||
- name: Install composer dependencies | ||
uses: ramsey/composer-install@v2 | ||
|
||
- name: Run PHPStan | ||
run: ./vendor/bin/phpstan --error-format=github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Access to an undefined property Spatie\\\\Image\\\\Drivers\\\\Color\\:\\:\\$alpha\\.$#" | ||
count: 1 | ||
path: src/Drivers/Gd/GdColor.php | ||
|
||
- | ||
message: "#^Access to an undefined property Spatie\\\\Image\\\\Drivers\\\\Color\\:\\:\\$blue\\.$#" | ||
count: 1 | ||
path: src/Drivers/Gd/GdColor.php | ||
|
||
- | ||
message: "#^Access to an undefined property Spatie\\\\Image\\\\Drivers\\\\Color\\:\\:\\$green\\.$#" | ||
count: 1 | ||
path: src/Drivers/Gd/GdColor.php | ||
|
||
- | ||
message: "#^Access to an undefined property Spatie\\\\Image\\\\Drivers\\\\Color\\:\\:\\$red\\.$#" | ||
count: 1 | ||
path: src/Drivers/Gd/GdColor.php | ||
|
||
- | ||
message: "#^Access to an undefined property Spatie\\\\Image\\\\Drivers\\\\ImageDriver\\:\\:\\$image\\.$#" | ||
count: 1 | ||
path: src/Drivers/Gd/GdDriver.php | ||
|
||
- | ||
message: "#^Method Spatie\\\\Image\\\\Drivers\\\\Gd\\\\GdDriver\\:\\:exif\\(\\) return type has no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Drivers/Gd/GdDriver.php | ||
|
||
- | ||
message: "#^Property Spatie\\\\Image\\\\Drivers\\\\Gd\\\\GdDriver\\:\\:\\$exif type has no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Drivers/Gd/GdDriver.php | ||
|
||
- | ||
message: "#^Unreachable statement \\- code above always terminates\\.$#" | ||
count: 1 | ||
path: src/Drivers/Gd/GdDriver.php | ||
|
||
- | ||
message: "#^Method Spatie\\\\Image\\\\Drivers\\\\ImageDriver\\:\\:exif\\(\\) return type has no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Drivers/ImageDriver.php | ||
|
||
- | ||
message: "#^Call to an undefined method Spatie\\\\Image\\\\Drivers\\\\Color\\:\\:getAlphaValue\\(\\)\\.$#" | ||
count: 1 | ||
path: src/Drivers/Imagick/ImagickColor.php | ||
|
||
- | ||
message: "#^Call to an undefined method Spatie\\\\Image\\\\Drivers\\\\Color\\:\\:getBlueValue\\(\\)\\.$#" | ||
count: 1 | ||
path: src/Drivers/Imagick/ImagickColor.php | ||
|
||
- | ||
message: "#^Call to an undefined method Spatie\\\\Image\\\\Drivers\\\\Color\\:\\:getGreenValue\\(\\)\\.$#" | ||
count: 1 | ||
path: src/Drivers/Imagick/ImagickColor.php | ||
|
||
- | ||
message: "#^Call to an undefined method Spatie\\\\Image\\\\Drivers\\\\Color\\:\\:getRedValue\\(\\)\\.$#" | ||
count: 1 | ||
path: src/Drivers/Imagick/ImagickColor.php | ||
|
||
- | ||
message: "#^Access to an undefined property Spatie\\\\Image\\\\Drivers\\\\ImageDriver\\:\\:\\$image\\.$#" | ||
count: 2 | ||
path: src/Drivers/Imagick/ImagickDriver.php | ||
|
||
- | ||
message: "#^Method Spatie\\\\Image\\\\Drivers\\\\Imagick\\\\ImagickDriver\\:\\:exif\\(\\) return type has no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Drivers/Imagick/ImagickDriver.php | ||
|
||
- | ||
message: "#^Property Spatie\\\\Image\\\\Drivers\\\\Imagick\\\\ImagickDriver\\:\\:\\$exif type has no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Drivers/Imagick/ImagickDriver.php | ||
|
||
- | ||
message: "#^Match expression does not handle remaining value\\: Spatie\\\\Image\\\\Enums\\\\Fit\\:\\:Crop$#" | ||
count: 1 | ||
path: src/Enums/Fit.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
includes: | ||
- phpstan-baseline.neon | ||
|
||
parameters: | ||
level: 6 | ||
paths: | ||
- src/ | ||
|
||
ignoreErrors: | ||
- '#Unsafe usage of new static#' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.