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/return types #257

Merged
merged 5 commits into from
Dec 3, 2024
Merged

Fix/return types #257

merged 5 commits into from
Dec 3, 2024

Conversation

darylldoyle
Copy link
Collaborator

Description of the Change

This PR goes through our scaffold and adds the correct return types to methods and functions. This will increase the reliability of static analysis available to engineers, either via their IDEs or a tool like PHPStan.

Additionally, it ensures that we, as a company, are starting engineers off on the best foot possible, with no potential errors caused by incorrect return types.

Finally, there are some places where I've added additional defensive coding to ensure that we don't inadvertently trigger errors.

How to test the Change

Test the scaffold locally.

Changelog Entry

  • Fixed - Return types

Credits

Props @darylldoyle

Checklist:

@darylldoyle darylldoyle self-assigned this Nov 29, 2024
Copy link
Member

@tobeycodes tobeycodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I'd love to see in a follow up PR in the future

  • Removal of mixed
  • Removal of phpstan ignore errors
  • Consistent return types on get_asset_info

Copy link
Member

@fabiankaegy fabiankaegy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with all that @tobeycodes already mentioned 👍

mu-plugins/10up-plugin/includes/core.php Show resolved Hide resolved
mu-plugins/10up-plugin/includes/utility.php Show resolved Hide resolved
@tlovett1
Copy link
Member

tlovett1 commented Dec 3, 2024

Looks good

@darylldoyle darylldoyle merged commit 4b860f4 into trunk Dec 3, 2024
3 checks passed
@darylldoyle darylldoyle deleted the fix/return-types branch December 3, 2024 18:58
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.

4 participants