Modified the isValid function's PHPDoc to reflect the actual functionality.