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

Update Psalm Annotations #101

Merged
merged 11 commits into from
May 29, 2021
Merged

Conversation

AlexandruGG
Copy link
Collaborator

@AlexandruGG AlexandruGG commented May 28, 2021

This PR is just #95 with fixes for the code analysis.

  • Replace @psalm-template with @template.
  • Replace @psalm-param with @param.
  • Replace @psalm-var with @var.
  • Replace @psalm-return with @return.

@@ -367,7 +367,7 @@ public function frequency(): CollectionInterface
* @template NewTKey
* @template NewT
*
* @param callable(...mixed): Iterator<NewTKey, NewT> $callable
* @param callable(mixed ...$parameters): iterable<NewTKey, NewT> $callable
Copy link
Collaborator Author

@AlexandruGG AlexandruGG May 28, 2021

Choose a reason for hiding this comment

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

  • the ...mixed syntax is not supported by PHPStan, but the mixed ...$parameters is supported by both Psalm and PHPStan

  • also note the collection can be instantiated with a callable returning any iterable, not just Iterator, as exemplified in the SA check

Copy link
Collaborator

Choose a reason for hiding this comment

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

Great!

@AlexandruGG
Copy link
Collaborator Author

Any clue what we could do about the unit tests failing on macOS? Have you seen this phpspec error before?

collaborator does not exist : spec\loophp\collection\Iterator\CacheItemPoolInterface

@AlexandruGG AlexandruGG marked this pull request as ready for review May 28, 2021 21:01
@drupol
Copy link
Collaborator

drupol commented May 28, 2021

Any clue what we could do about the unit tests failing on macOS? Have you seen this phpspec error before?

collaborator does not exist : spec\loophp\collection\Iterator\CacheItemPoolInterface

This is temporary, I guess it will be fixed upstream very soon. I guess we can agree to ignore it for now. ok ?

@AlexandruGG
Copy link
Collaborator Author

Any clue what we could do about the unit tests failing on macOS? Have you seen this phpspec error before?

collaborator does not exist : spec\loophp\collection\Iterator\CacheItemPoolInterface

This is temporary, I guess it will be fixed upstream very soon. I guess we can agree to ignore it for now. ok ?

Yeah that's fine. This is ready otherwise, but take your time to review again as it's quite big 😄

@drupol drupol merged commit 4683aea into loophp:master May 29, 2021
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

2 participants