shish/phpstan-matchy-string

PHPStan rule for strings that match certain conditions

Installs: 2 153

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/shish/phpstan-matchy-string

v0.0.0 2025-06-04 00:37 UTC

This package is auto-updated.

Last update: 2025-10-04 01:22:16 UTC


README

  • patterns defined in phpstan.neon, eg email-string: '^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$'
  • function defined like:
/**
 * @param email-string $email
 */
function sendEmail(string $email): void {
    ...
}
  • phpstan will then allow sendEmail("bob@example.com") but not sendEmail("bob@example")