diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index f13aa24..b212264 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -109,6 +109,7 @@ 'prefix' => 'provide', 'suffix' => 'Cases', ], + 'phpdoc_summary' => false, 'phpdoc_align' => [ 'align' => 'left', 'spacing' => 1, diff --git a/composer.json b/composer.json index 7ff1773..400dd33 100644 --- a/composer.json +++ b/composer.json @@ -164,8 +164,8 @@ "@dump-soar-php-config", "@dump-soar-yaml-config" ], - "dump-soar-docblock": "Guanguans\\SoarPHP\\Support\\ComposerScript::dumpSoarDocblock", - "dump-soar-php-config": "Guanguans\\SoarPHP\\Support\\ComposerScript::dumpSoarConfig", + "dump-soar-docblock": "Guanguans\\SoarPHP\\Support\\ComposerScripts::dumpSoarDocblock", + "dump-soar-php-config": "Guanguans\\SoarPHP\\Support\\ComposerScripts::dumpSoarConfig", "dump-soar-yaml-config": "./bin/soar.darwin-amd64 -print-config -verbose > examples/soar.options.example.yaml", "json-lint": "@php ./vendor/bin/jsonlint *.json .*rc", "lint": [ diff --git a/examples/soar.options.docblock.php b/examples/soar.options.docblock.php index 08607d1..9083528 100644 --- a/examples/soar.options.docblock.php +++ b/examples/soar.options.docblock.php @@ -11,7 +11,7 @@ * @see https://github.com/guanguans/soar-php */ /** - * AllowCharsets (default "utf8,utf8mb4"). + * AllowCharsets (default "utf8,utf8mb4") * * @method self addAllowCharsets(string $allowCharsets) * diff --git a/src/Support/ComposerScript.php b/src/Support/ComposerScripts.php similarity index 87% rename from src/Support/ComposerScript.php rename to src/Support/ComposerScripts.php index 1ad236d..b274549 100644 --- a/src/Support/ComposerScript.php +++ b/src/Support/ComposerScripts.php @@ -19,7 +19,7 @@ /** * @internal */ -final class ComposerScript +final class ComposerScripts { /** * @noinspection PhpUnused @@ -36,11 +36,12 @@ public static function dumpSoarDocblock(Event $event): int declare(strict_types=1); /** - * This file is part of the guanguans/soar-php. + * Copyright (c) 2019-2025 guanguans * - * (c) guanguans + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. * - * This source file is subject to the MIT license that is bundled. + * @see https://github.com/guanguans/soar-php */ /** docblock; @@ -73,7 +74,7 @@ static function (string $docblock, array $option) use ($typeOfMethod, $t): strin $option['type'] = 'int'; } - if (0 === strncmp($typeOfMethod, 'get', \strlen('get')) && null === $option['type']) { + if (null === $option['type'] && 0 === strncmp($typeOfMethod, 'get', \strlen('get'))) { $option['type'] = 'mixed'; } @@ -115,11 +116,12 @@ public static function dumpSoarConfig(Event $event): int declare(strict_types=1); /** - * This file is part of the guanguans/soar-php. + * Copyright (c) 2019-2025 guanguans * - * (c) guanguans + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. * - * This source file is subject to the MIT license that is bundled. + * @see https://github.com/guanguans/soar-php */ // +----------------------------------------------------------------------+// @@ -174,8 +176,8 @@ public static function extractOptionsFromHelp(): array $default = $defaults[0] ?? null; - if (\is_string($default) && 0 === strncmp($default, $pre = '(default ', \strlen($pre = '(default '))) { - $default = rtrim(substr($default, \strlen($pre)), ')'); + if (\is_string($default) && 0 === strncmp($default, $prefix = '(default ', \strlen($prefix))) { + $default = rtrim(substr($default, \strlen($prefix)), ')'); } $options[$names[0]] = [