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

Add retry helper stub #543

Merged
merged 2 commits into from
Apr 24, 2020
Merged

Conversation

Daanra
Copy link
Contributor

@Daanra Daanra commented Apr 23, 2020

Adds a stub for the retry helper with more accurate PHPDoc annotations.

This ensures that the following things will be seen as invalid by Larastan:

public function do(): int
{
   return retry(2, function (): string { // int and string mismatch
      return 'hello';
   });
}
retry(2, function ($param): int { // Retry does not accept a parameter in its closure
      return 5;
});

Copy link
Collaborator

@canvural canvural left a comment

Choose a reason for hiding this comment

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

The actual filename is helpers.stub but it should be Helpers.stub. Other than that looks good 👍

@canvural canvural merged commit e44134d into larastan:master Apr 24, 2020
@canvural
Copy link
Collaborator

Thank you!

@szepeviktor
Copy link
Collaborator

maybe a file with procedural code should not have uppercases

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.

None yet

3 participants