Replies: 3 comments 4 replies
-
Feel free to PR improvements |
Beta Was this translation helpful? Give feedback.
-
Alright I figured out where the problem come from. The __call method from the class Image is used to return the object everytime a method is used. I think that the issue comes from php stan that doesn't recognize the type returned by the function __call, so phpstan doesn't understand that the save method does exists and returned the error of an undefined method. So the practice work but the php stan scan doesn't on this particular case. |
Beta Was this translation helpful? Give feedback.
-
I fixed that by using the $manipulations = (new Manipulations())->manualCrop($this->crop['width'], $this->crop['height'], $this->crop['x'], $this->crop['y']);
Image::load(storage_path('app/public/'.$picture))->manipulate($manipulations)->save(); |
Beta Was this translation helpful? Give feedback.
-
Hey,
I have the following code that changes the background and optimize my image:
Image::load($filePathName)->background('transparent')->optimize()->save();
It works pretty well but, when I use phpstan on level 2, I get the following error:
Call to an undefined method Spatie\Image\Manipulations::save()
Despite the fact that the method does exist...
Does anyone faced the same issue ?
Beta Was this translation helpful? Give feedback.
All reactions