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

chore: Add parameter type hints to parameters #48195

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nickvergessen
Copy link
Member

  • Resolves: #

Summary

TODO

  • ...

Checklist

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

👍 except for the structures that are possibly implemented/extended by apps

@@ -26,5 +26,5 @@ interface IProvider {
* when they did not handle the event. Throwing \InvalidArgumentException directly is deprecated and will
* be logged as an error in Nextcloud 39.
*/
public function parse($language, IEvent $event, ?IEvent $previousEvent = null);
public function parse(string $language, IEvent $event, ?IEvent $previousEvent = null);
Copy link
Member

Choose a reason for hiding this comment

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

Possibly implemented by apps

Copy link
Member Author

Choose a reason for hiding this comment

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

but its an interface, so it can be stronger than an implementation

* @since 7.0.0
*/
public function __construct($msg) {
public function __construct(string $msg) {
Copy link
Member

Choose a reason for hiding this comment

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

Possibly extended by an app

Copy link
Member Author

Choose a reason for hiding this comment

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

Same for AppFramework/ApiController.php and many more …
I thought it's only for the parameters, but yeah when it's not an interface but a class, we need to do it the other way around

@nickvergessen nickvergessen force-pushed the techdebt/noid/add-parameter-typehints branch from fe23079 to e271318 Compare September 19, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants