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

feat: return types are required in all new methods and functions #179

Merged

Conversation

millnut
Copy link
Member

@millnut millnut commented Nov 24, 2024

What does this change?

This follows Drupal's latest coding standards/PHPStan changes to make return types required in all new methods and functions (see https://www.drupal.org/node/3461320). This applies to Core as well as contrib modules which run through the GitLab pipeline.

Since Drupal 9 it has been recommended to add return types, however it has not been enforced until now

Parameter and return type hinting
Beginning with Drupal 9, parameter and return type hints should be used wherever possible.

I've updated the PHPStan baseline so this will only apply to new code. I'll create separate tickets for updating existing code.

@finnlewis finnlewis merged commit 74bede7 into 3.x Nov 26, 2024
8 checks passed
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