From 7d0577460f999f077e1a0b3a2439d16a4f2e439c Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 1 Aug 2025 02:05:46 +0800 Subject: [PATCH] cs-fix --- src/SPC/util/ConfigValidator.php | 50 ++++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) 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) *