@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | public static function getAlphaValidator(?array $additionalCharacters = null, ?string $hint = null): \Closure |
| 13 | 13 | { |
| 14 | - return function (string $value) use ($additionalCharacters, $hint) { |
|
| 14 | + return function(string $value) use ($additionalCharacters, $hint) { |
|
| 15 | 15 | $value = trim($value); |
| 16 | 16 | $pattern = '/^[a-zA-Z0-9'; |
| 17 | 17 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public static function getAbsolutePathValidator(): \Closure |
| 39 | 39 | { |
| 40 | - return function (string $value) { |
|
| 40 | + return function(string $value) { |
|
| 41 | 41 | $value = trim($value); |
| 42 | 42 | if (!\preg_match('/^[\'"]?(?:\/[^\/\n]+)*[\'"]?$/', $value)) { |
| 43 | 43 | throw new \InvalidArgumentException('Invalid value "' . $value . '". Hint: path has to be absolute without trailing "/".'); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public static function getDomainNameValidator(): \Closure |
| 50 | 50 | { |
| 51 | - return function (string $value) { |
|
| 51 | + return function(string $value) { |
|
| 52 | 52 | $value = trim($value); |
| 53 | 53 | if (!\preg_match('/^(?!:\/\/)([a-zA-Z0-9-_]+\.)*[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?$/im', $value)) { |
| 54 | 54 | throw new \InvalidArgumentException('Invalid value "' . $value . '". Hint: the domain name must not start with "http(s)://".'); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | public static function getDomainNameWithPortValidator(): \Closure |
| 61 | 61 | { |
| 62 | - return function (string $value) { |
|
| 62 | + return function(string $value) { |
|
| 63 | 63 | $value = trim($value); |
| 64 | 64 | if (!\preg_match('/^(?!:\/\/)([a-zA-Z0-9-_]+\.)*[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?:\d*$/im', $value)) { |
| 65 | 65 | throw new \InvalidArgumentException('Invalid value "' . $value . '". Hint: the domain name must not start with "http(s)://".'); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | public static function getIPv4Validator(): \Closure |
| 72 | 72 | { |
| 73 | - return function (string $value) { |
|
| 73 | + return function(string $value) { |
|
| 74 | 74 | $value = trim($value); |
| 75 | 75 | if (!\preg_match('/^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/', $value)) { |
| 76 | 76 | throw new \InvalidArgumentException('Invalid value "' . $value . '".'); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | public static function getDockerImageWithoutTagValidator(): \Closure |
| 83 | 83 | { |
| 84 | - return function (string $value) { |
|
| 84 | + return function(string $value) { |
|
| 85 | 85 | $value = trim($value); |
| 86 | 86 | if (!\preg_match('/^[a-z0-9]+\/([a-z0-9]+(?:[._-][a-z0-9]+)*)$/', $value)) { |
| 87 | 87 | throw new \InvalidArgumentException('Invalid value "' . $value . '". Hint: the docker image should be of type "username/repository"'); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | public static function getDockerImageWithTagValidator(): \Closure |
| 94 | 94 | { |
| 95 | - return function (string $value) { |
|
| 95 | + return function(string $value) { |
|
| 96 | 96 | $value = trim($value); |
| 97 | 97 | if (!\preg_match('/^[a-z0-9]+\/([a-z0-9]+(?:[._-][a-z0-9]+)*)(:[\w]+([\w._-]+)?)$/', $value)) { |
| 98 | 98 | throw new \InvalidArgumentException('Invalid value "' . $value . '". Hint: the docker image should be of type "username/repository:tag"'); |