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

[v3] add type hints to function signatures #577

Merged
merged 7 commits into from
May 22, 2024
Merged

[v3] add type hints to function signatures #577

merged 7 commits into from
May 22, 2024

Conversation

stklcode
Copy link
Contributor

@stklcode stklcode commented Mar 17, 2024

based on #575, #576 and #579 (all merged)


  • raise required PHP version from 7.0 to 7.2
    We have nullable and void return types, so we can annotate almost every method (some union and mixed types missing, those are PHP 8 features)
  • add type hints where possible
  • remote redundant type checks in method bodies
  • use null coalescing operator (??) where applicable

Fixed 2 minor bugs that came up during this refactoring:

  • add missing return statement to Linkback::process()
  • ensure $implements_interface is initialized in ComponentHelper

@stklcode stklcode self-assigned this Mar 17, 2024
@stklcode stklcode added the v3 This issue is for the new version (v3) of the plugin label Mar 17, 2024
@stklcode stklcode changed the title [WIP] [v3] add type hints and extend documentation [WIP] [v3] add type hints to interfaces and base classes Mar 18, 2024
@stklcode stklcode force-pushed the v3-hints branch 3 times, most recently from ba3f203 to 6576f6c Compare March 23, 2024 10:08
@stklcode stklcode force-pushed the v3-hints branch 2 times, most recently from 813c36f to 59fc283 Compare March 24, 2024 09:45
Types are now checked at function call, so we can assume the type is
always correct at time of execution.
@stklcode stklcode changed the title [WIP] [v3] add type hints to interfaces and base classes [v3] add type hints to function signatures Mar 24, 2024
@stklcode stklcode marked this pull request as ready for review March 24, 2024 10:01
@stklcode stklcode added this to the 3.0 milestone Mar 24, 2024
@stklcode stklcode merged commit dc406b3 into v3 May 22, 2024
3 checks passed
@stklcode stklcode deleted the v3-hints branch May 22, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 This issue is for the new version (v3) of the plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants