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

Improve DX by specifying namespace for GD functions #274

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

alies-dev
Copy link
Contributor

@alies-dev alies-dev commented Aug 20, 2024

Why: some of these functions are optional and can be not available in the installed PHP. When PHP couldn't find functions in the current and root namespaces, it reports a missing function in the current namespace. As a result, an Error message is misleading.
Example: Call to undefined function Spatie\Image\Drivers\Gd\imageavif()

CleanShot 2024-08-20 at 23 51 39@2x

With this small fix, the error message will be:

Call to undefined function imageavif()

Why: some of these functions are optional and can be not available in the installed PHP.
When PHP couldn't find functions in the current and root namespaces, it reports about missing function in the current namespace.
As result, Error message is misleading.
Example: "Call to undefined function Spatie\Image\Drivers\Gd\imageavif()"
@freekmurze freekmurze merged commit 349be3e into spatie:main Aug 22, 2024
3 checks passed
@freekmurze
Copy link
Member

Thanks!

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