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

fix: PHPDoc block in Translatable facade #448

Merged

Conversation

kyryl-bogach
Copy link
Contributor

Fix fallback method definition that is lacking "void", occasioning code analyzers like PHPStan to fail. This was recently introduced here.

The previous PHPdoc is not a valid php-doc comment and causes issues on, for example, PHPStan when analyzing the code:

image

Fix fallback method definition that is lacking "void", occasioning code analyzers like PHPStan to fail.
@freekmurze freekmurze merged commit 8c6c353 into spatie:main May 14, 2024
1 check passed
@freekmurze
Copy link
Member

Thanks!

@Muetze42
Copy link
Contributor

Oh. I've just looked again.

If the intended method is static, the static keyword can be placed before the return type to communicate that. In that case, a return type MUST be provided, as static on its own would mean that the method returns an instance of the child class which the method is called on.

https://docs.phpdoc.org/latest/guide/references/phpdoc/tags/method.html

PhpStorm did not show me an error either. I actually didn't know that it had to be specified for static methods.
Now I know and it no longer occurs.

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.

3 participants