diff --git a/src/SPC/util/ConfigValidator.php b/src/SPC/util/ConfigValidator.php index 3415b25f..baa42b59 100644 --- a/src/SPC/util/ConfigValidator.php +++ b/src/SPC/util/ConfigValidator.php @@ -66,31 +66,6 @@ class ConfigValidator } } - /** - * @throws ValidationException - */ - private static function checkSingleLicense(array $license, string $name): void - { - if (!is_assoc_array($license)) { - throw new ValidationException("source {$name} license must be an object"); - } - if (!isset($license['type'])) { - throw new ValidationException("source {$name} license must have type"); - } - if (!in_array($license['type'], ['file', 'text'])) { - throw new ValidationException("source {$name} license type is invalid"); - } - if (!in_array($license['type'], ['file', 'text'])) { - throw new ValidationException("source {$name} license type is invalid"); - } - if ($license['type'] === 'file' && !isset($license['path'])) { - throw new ValidationException("source {$name} license file must have path"); - } - if ($license['type'] === 'text' && !isset($license['text'])) { - throw new ValidationException("source {$name} license text must have text"); - } - } - /** * @throws ValidationException */ @@ -440,6 +415,31 @@ class ConfigValidator return $craft; } + /** + * @throws ValidationException + */ + private static function checkSingleLicense(array $license, string $name): void + { + if (!is_assoc_array($license)) { + throw new ValidationException("source {$name} license must be an object"); + } + if (!isset($license['type'])) { + throw new ValidationException("source {$name} license must have type"); + } + if (!in_array($license['type'], ['file', 'text'])) { + throw new ValidationException("source {$name} license type is invalid"); + } + if (!in_array($license['type'], ['file', 'text'])) { + throw new ValidationException("source {$name} license type is invalid"); + } + if ($license['type'] === 'file' && !isset($license['path'])) { + throw new ValidationException("source {$name} license file must have path"); + } + if ($license['type'] === 'text' && !isset($license['text'])) { + throw new ValidationException("source {$name} license text must have text"); + } + } + /** * Validate source type configuration (shared between source.json and pkg.json) *