Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phpstan fixes #206

Merged
merged 5 commits into from
Dec 1, 2023
Merged

Phpstan fixes #206

merged 5 commits into from
Dec 1, 2023

Conversation

Nielsvanpach
Copy link
Member

No description provided.

@freekmurze freekmurze merged commit 4f0aadc into v3 Dec 1, 2023
2 of 7 checks passed
@Nielsvanpach Nielsvanpach deleted the phpstan-fixes branch December 1, 2023 14:08
freekmurze added a commit that referenced this pull request Dec 14, 2023
* remove temp

* Fix styling

* Update .gitignore to include "tests/TestSupport/temp/"

* add enums

* implement contain

* Fix styling

* refactor

* Fix styling

* implement fit for gd

* Fix styling

* refactor

* Fix styling

* implement fit for gd

* Update fit dimensions in FitTest.php

* Add Gamma method.

* Add contrast method.

* Fix styling

* add fill

* Fix styling

* add fill max

* Fix styling

* refactor to fit enum

* refactor enum

* add stretch test

* Fix styling

* color format casing

* moving namespaces

* rename class

* improve crop enum

* Refactored manual crop method to allow cropping an image to the given dimensions and position

* add crop

* Fix styling

* add crops

* Fix styling

* add crop test

* Fix styling

* implement focal crop

* Fix styling

* Save GD images in multiple formats.

* Validate format when saving.

* Fix styling

* Code style
'

* Code style.

* Add colorize logic.

* Fix test.

* Fix styling

* Add sepia method.

* Fix styling

* Add sharpen method.

* Fix styling

* Add base64 method.

* Add background method.

* Fix styling

* Refactor.

* Refactor.

* Documentation.

* Fix styling

* Orientation method.

* Fix styling

* Allow access to exif data.

* Add flip method.

* Fix styling

* wip

* Fix styling

* add snapshots

* Add pixelate method.

* improve fliptest

* Fix styling

* improve tests

* manual crop test

* Add pixelmatch dependency for testing

* Fix styling

* add focal crop test cases

* improve flip test

* add test

* Add test case for cropping an image relative to the right position

* add test

* add test

* add test

* add test

* make sure fit contain is correct

* make sure fit fill is correct

* make sure fit fill is correct

* make sure fill is correct

* remove ray call

* simplify gd modify function

* Fix styling

* refactor

* add insert method

* Fix styling

* add border functions

* Fix styling

* nitpick

* Refactor file paths for color tests

* ensure file format

* Fix styling

* Add quality method.

* Fix styling

* Improve test.

* Fix webp.

* Quality test snapshots.

* Add node_modules to gitignore.

* Deduplicate GD overlay method.

* Deduplicate imagick overlay method.

* Fix test.

* Update snapshot.

* Fix base64 method for imagick.

* Add imageset class.

* Fix styling

* Add support for PNG format in quality tests

* fix test

* fix test

* v3

* Fix image quality for Imagick.

* update tests

* improve test

* Fix styling

* improve readablity

* polish

* Refactor exception handling in `InvalidManipulation` and `Size` classesThe commit message is too long. The maximum character length is 50

* Fix styling

* Refactor resizeWidth and resizeHeight methods in Size class

* Fix styling

* Improve blur output on Imagick.

* fix method name

* Add image optimizations.

* Update snapshots

* Update snapshots

* Remove magic

* Update snapshots

* Update docs for image optimizations.

* Image driver enum.

* Add upgrade guide.

* Upgrade guide.

* Fix styling

* Update docs.

* Update docs.

* Update docs.

* Update docs.

* Update docs.

* Update docs.

* Add Heic support/test.

* Add tiff support/test.

* Document supported formats.

* Simplify tests.

* Fix styling

* Simplify tests.

* Code style.

* Docs.

* improve readability

* Fix styling

* remove drift

* nitpicks

* Fix styling

* remove unused code

* Use sensible boundaries for pixelate method.

* Update docs.

* Update docs for border method.

* Update docs for border method.

* Update docs for orientation method.

* Update docs for flip method.

* Docs.

* Fix typo in filename.

* Add missing resize test.

* Fix styling

* Add width and height methods.

* Resize test.

* Resize docs.

* Mark 2 tests as failing.

* Update docs.

* Update snapshots.

* Update docs.

* Update crop docs.

* Fix styling

* Update crop docs.

* Watermark docs.

* Docs.

* Docs.

* Use original path if no new path is provided when saving.

* Docs.

* Docs.

* Fix styling

* Docs.

* Update ResizeTest.php

* fix resize gd

* fix fit and background for imagick

* update snapshot

* fix test

* FitTest

* update snapshots

* Color docs.

* Base64 docs.

* Colorize docs.

* add format function

* Fix styling

* make save path optional

* add optimize to interface

* Add PHPstan (#205)

* 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>

* Phpstan fixes (#206)

* remove positive_int annotations

will fail on a 0 value

* alpha values can be floats

* increase phpstan level + fixes

* Fix styling

* exclude relevant phpstan issues from baseline

---------

Co-authored-by: Nielsvanpach <Nielsvanpach@users.noreply.github.com>

* handle empty images

* Fix styling

* Fix Heic and Tiff test.

* Fix converting rgba from string.

* Fix background test.

* Exclude phpunit cache.

* Fix base64 saving file.

* cs

* wip

* Move validations to base Image class.

* Refactor fixes.

* Fix styling

* fix signature of optimize

* import class

* Install optimizers on GH actions

* Adjust match treshold.

* Adjust match treshold.

* Adjust match treshold.

* improve types

* "Skip test when running on GitHub actions"

* credits

* prep docs

---------

Co-authored-by: Freek Van der Herten <freek@spatie.be>
Co-authored-by: freekmurze <freekmurze@users.noreply.github.com>
Co-authored-by: timvandijck <timvandijck@users.noreply.github.com>
Co-authored-by: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com>
Co-authored-by: Nielsvanpach <Nielsvanpach@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants