You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
422 B
PHP
17 lines
422 B
PHP
<?php
|
|
|
|
namespace App\Services\Cloud;
|
|
|
|
/** Panel-owned reference to an existing host bridge or libvirt network. */
|
|
final class CloudNetworkSelector
|
|
{
|
|
public static function isValid(mixed $value): bool
|
|
{
|
|
return is_string($value) && preg_match(
|
|
'/^(?:bridge:[A-Za-z0-9][A-Za-z0-9_.-]{0,14}'
|
|
. '|network:[A-Za-z0-9][A-Za-z0-9_.-]{0,63})$/D',
|
|
$value
|
|
) === 1;
|
|
}
|
|
}
|