You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello I just updated phpstan-webmozart-assert to v1.0.7 and my codebase started reporting this error:
Call to static method Webmozart\Assert\Assert::upper() with non-empty-string will always evaluate to true.
It's failing in the following class construct
final class CityCode
{
private function __construct(private string $cityCode)
{
}
public static function fromString(string $cityCode) : self
{
Assert::length($cityCode, 3);
Assert::upper($cityCode);
return new self($cityCode);
}
}
I'm not using the non-empty-string type assertion anywhere so it must be resolved from the length assertion, however that doesn't ensure what upper is doing.
Thank you for looking into this, and all your great work.