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

ENH Add generic types #819

Merged

Conversation

GuySartorelli
Copy link
Contributor

@GuySartorelli GuySartorelli commented Jan 12, 2024

Description

  • Add generic types where appropriate, e.g. for indicating the type of records inside DataList or ArrayList.
  • Replace @property annotation for extension $owner property with a generic extension. This works effectively the same way, with the bonus benefit that the return type for getOwner() is also correct.
  • Remove unnecessary @var comments.

Requires silverstripe/silverstripe-framework#11108 for these generics to take effect.

Manual testing steps

You can validate that the types are evaluating correctly in your preferred code editor.

Issues

Pull request checklist

  • The target branch is correct
  • All commits are relevant to the purpose of the PR (e.g. no debug statements, unrelated refactoring, or arbitrary linting)
    • Small amounts of additional linting are usually okay, but if it makes it hard to concentrate on the relevant changes, ask for the unrelated changes to be reverted, and submitted as a separate PR.
  • The commit messages follow our commit message guidelines
  • The PR follows our contribution guidelines
  • Code changes follow our coding conventions
  • Tests aren't necessary for this change
  • CI is green

- Add generic types where appropriate, e.g. for indicating the type of
records inside DataList or ArrayList.
- Replace @Property annotation for extension $owner property with a
generic extension. This works effectively the same way, with the bonus
benefit that the return type for getOwner() is also correct.
- Remove unnecessary @var comments.
@tractorcow
Copy link
Collaborator

Nice work, I love attention to phpdoc.

@tractorcow tractorcow merged commit 599479d into tractorcow-farm:7 Jan 12, 2024
10 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