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

Fixed template in Await::promise() #204

Merged
merged 1 commit into from
Sep 16, 2023
Merged

Conversation

JavierLeon9966
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (90f4dda) 92.73% compared to head (c406b03) 92.73%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #204   +/-   ##
=========================================
  Coverage     92.73%   92.73%           
  Complexity      162      162           
=========================================
  Files            12       12           
  Lines           454      454           
=========================================
  Hits            421      421           
  Misses           33       33           
Files Changed Coverage Δ
await-generator/src/SOFe/AwaitGenerator/Await.php 89.87% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JavierLeon9966
Copy link
Contributor Author

JavierLeon9966 commented Sep 15, 2023

It turns out PHPStan just says this can't be solved:

$players = yield from Await::promise(fn(Closure $resolve) => $provider->getTopKills()->onCompletion($resolve, static function(): void{

}));

But this works:

/** @phpstan-var Closure(Closure(array<string, int> $value): void $resolve): void $closure */
$closure = fn(Closure $resolve) => $provider->getTopKills()->onCompletion($resolve, static function(): void{

});
$players = yield from Await::promise($closure);

@SOF3
Copy link
Owner

SOF3 commented Sep 16, 2023

this was also fixed in the v4 branch by removing generics from the class and only keeping them to the function.

@SOF3 SOF3 merged commit 0021b25 into SOF3:master Sep 16, 2023
6 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.

None yet

3 participants