-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Description
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.
Metadata
Metadata
Assignees
Labels
No labels