Skip to content

Fix phpstan issues #113

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

Merged
merged 3 commits into from
May 27, 2018
Merged

Fix phpstan issues #113

merged 3 commits into from
May 27, 2018

Conversation

eigan
Copy link
Contributor

@eigan eigan commented May 25, 2018

The two most important issues affects projects using this library and also using phpstan. The error we get in our project is the following:

Call to method getImageAsString() on an unknown class static.

static is not in a namespace

-     * @return \static
+     * @return static

PHPStan thinks that \static is a class in the root namespace. Its perfectly fine to use just static instead.

Wrong return type

-     * @return integer
+     * @return float|integer

This method actually returns floats too. Not too important, but good to know.

Wrong casing of functions

-            $this->original_w = ImageSX($this->source_image);
-            $this->original_h = ImageSY($this->source_image);
+            $this->original_w = imagesx($this->source_image);
+            $this->original_h = imagesy($this->source_image);

Not affecting anything, so can revert this change if you like.

These changes will also make php-image-resize pass the first level (0)

@adityapatadia adityapatadia merged commit 24c6395 into gumlet:master May 27, 2018
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