assert icon indicating copy to clipboard operation
assert copied to clipboard

Assert::allOneOf get complains from phpStan on usage

Open monro93 opened this issue 4 years ago • 3 comments

Hi, Thanks for your library! I have discovered the following issue: The method allOneOf($values, $values, $message = '') of Webmozart\Assert has in the signature two variables with the same name "values", this is confusing PhpStan, the static analyzer, thinking that the method has only 2 arguments, so when is called with 3 is giving the following error: Static method Webmozart\Assert\Assert::allOneOf() invoked with 3 parameters, 1-2 required.

I will submit a PR this afternoon/first days of the next week

Thanks!

monro93 avatar Apr 17 '20 06:04 monro93

Haven't ran into this myself yet, but if youre willing to provide a PR, that would be great, thanks

BackEndTea avatar Apr 18 '20 09:04 BackEndTea

Will be fixed in https://github.com/webmozart/assert/pull/126

zerkms avatar May 30 '20 11:05 zerkms

@monro93 Can you verify that this is no longer an issue in a newer version?

BackEndTea avatar Jun 03 '22 18:06 BackEndTea