add to be url expectation

This commit is contained in:
JonPurvis
2023-10-09 20:02:11 +01:00
parent 2ffafd445d
commit 5101b9dce3
3 changed files with 48 additions and 0 deletions

View File

@ -108,4 +108,12 @@ final class Str
{
return sprintf('`%s` → %s', $describeDescription, $testDescription);
}
/**
* Determine if a given value is a valid URL.
*/
public static function isUrl(string $value): bool
{
return (bool) filter_var($value, FILTER_VALIDATE_URL);
}
}