Skip to content

Commit 0fabcf1

Browse files
committed
move functions around
1 parent 5d9c108 commit 0fabcf1

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

resources/lib/UnityConfig.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -73,34 +73,6 @@ public static function validateConfig(array $CONFIG): void
7373
self::validateMailSmtpConfig($CONFIG);
7474
}
7575

76-
/** @param mixed[] $x */
77-
private static function validateArrayNotEmpty(array $x, string $name): void
78-
{
79-
if (count($x) === 0) {
80-
throw new InvalidConfigurationException("$name must not be empty");
81-
}
82-
}
83-
84-
private static function validateStringNotEmpty(string $x, string $name): void
85-
{
86-
if (empty($x)) {
87-
throw new InvalidConfigurationException("$name must not be empty");
88-
}
89-
}
90-
91-
/** @param mixed[] $options */
92-
private static function validateOneOf(string $x, string $name, array $options): void
93-
{
94-
foreach ($options as $option) {
95-
if ($x === $option) {
96-
return;
97-
}
98-
}
99-
throw new InvalidConfigurationException(
100-
sprintf("%s must be one of %s", $name, _json_encode($options)),
101-
);
102-
}
103-
10476
/** @param mixed[] $CONFIG */
10577
private static function validateExpiryConfig(array $CONFIG): void
10678
{
@@ -148,6 +120,34 @@ private static function validateMailSmtpConfig(array $CONFIG): void
148120
self::validateOneOf($CONFIG["smtp"]["ssl_verify"], '$CONFIG["smtp"]["ssl_verify"]', [0, 1]);
149121
}
150122

123+
/** @param mixed[] $x */
124+
private static function validateArrayNotEmpty(array $x, string $name): void
125+
{
126+
if (count($x) === 0) {
127+
throw new InvalidConfigurationException("$name must not be empty");
128+
}
129+
}
130+
131+
private static function validateStringNotEmpty(string $x, string $name): void
132+
{
133+
if (empty($x)) {
134+
throw new InvalidConfigurationException("$name must not be empty");
135+
}
136+
}
137+
138+
/** @param mixed[] $options */
139+
private static function validateOneOf(string $x, string $name, array $options): void
140+
{
141+
foreach ($options as $option) {
142+
if ($x === $option) {
143+
return;
144+
}
145+
}
146+
throw new InvalidConfigurationException(
147+
sprintf("%s must be one of %s", $name, _json_encode($options)),
148+
);
149+
}
150+
151151
private static function assertHttpHostValid(string $host): void
152152
{
153153
if (!_preg_match("/^[a-zA-Z0-9._:-]+$/", $host)) {

0 commit comments

Comments
 (0)