Skip to content

Add some PHPDoc type annotations #206

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

Merged
merged 2 commits into from
May 3, 2021

Conversation

oliverklee
Copy link
Collaborator

This will help static type analysis tools.

@sabberworm
Copy link
Collaborator

Really cool, thanks. Is there some check we could install into the CI build that ensures everything remains annotated?

@oliverklee
Copy link
Collaborator Author

Is there some check we could install into the CI build that ensures everything remains annotated?

Yes, I will add PHPStan checks later to make sure the types are correct.

We can also add PHP_CodeSniffer checks for checking for the presence of type annotations, but I'd like to avoid that as we probably won't need many of them once we've updated the PHP requirement and we can use more of the native type declarations.

@westonruter
Copy link
Collaborator

We can also add PHP_CodeSniffer checks for checking for the presence of type annotations, but I'd like to avoid that as we probably won't need many of them once we've updated the PHP requirement and we can use more of the native type declarations.

Updating the PHP requirement detrimental for WordPress which still supports PHP 5.6. If PHPDoc can be used until WordPress increases the minimum, this would be ideal. Otherwise, the dozens of WordPress plugins that use PHP-CSS-Parser would be forced to fork the package.

@oliverklee oliverklee force-pushed the cleanup/type-annotations branch 2 times, most recently from f1b2da6 to 1c3771f Compare April 23, 2021 09:49
This will help static type analysis tools.
@oliverklee oliverklee force-pushed the cleanup/type-annotations branch from 1c3771f to eedbd65 Compare April 30, 2021 13:14
@oliverklee
Copy link
Collaborator Author

@westonruter @sabberworm I'd really appreciate this PR getting reviewed and merged as it blocks other things I'd like to work on that also touch the code. Thanks! ❤️

Copy link
Collaborator

@westonruter westonruter left a comment

Choose a reason for hiding this comment

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

Looks good! Just one additional phpdoc tag that I saw could be added as well.

Co-authored-by: Weston Ruter <westonruter@google.com>
@sabberworm sabberworm merged commit a010f9a into MyIntervals:master May 3, 2021
@oliverklee oliverklee deleted the cleanup/type-annotations branch May 3, 2021 16:39
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