File tree Expand file tree Collapse file tree 4 files changed +48
-32
lines changed
Expand file tree Collapse file tree 4 files changed +48
-32
lines changed Original file line number Diff line number Diff line change 164164 " @composer-normalize" ,
165165 " @composer-validate" ,
166166 " @check-soar-binary" ,
167- " @dump-soar-yaml- config" ,
167+ " @dump-soar-config" ,
168168 " @json-lint" ,
169169 " @md-lint" ,
170170 " @yaml-lint" ,
191191 " @dump-soar-yaml-config" ,
192192 " @dump-soar-php-config"
193193 ],
194+ "dump-soar-original-php-config" : " Guanguans\\ SoarPHP\\ Support\\ ComposerScripts::dumpSoarPHPConfig" ,
194195 "dump-soar-php-config" : [
196+ " @dump-soar-original-php-config" ,
195197 " @rector-soar-options" ,
196198 " @style-fix"
197199 ],
Original file line number Diff line number Diff line change 1515 * @see https://github.com/guanguans/soar-php
1616 */
1717
18- use Guanguans \SoarPHP \Support \ComposerScripts ;
1918use Guanguans \SoarPHP \Support \Rectors \AddSoarOptionsDocCommentRector ;
2019use Guanguans \SoarPHP \Support \Rectors \SimplifyListIndexRector ;
2120use Rector \Config \RectorConfig ;
2221use Rector \ValueObject \PhpVersion ;
2322
24- file_put_contents (
25- $ path = __DIR__ .'/examples/soar-options.php ' ,
26- $ code = \sprintf (
27- <<<'PHP'
28- <?php
29-
30- declare(strict_types=1);
31-
32- /**
33- * Copyright (c) 2019-2025 guanguans<ityaozm@gmail.com>
34- *
35- * For the full copyright and license information, please view
36- * the LICENSE file that was distributed with this source code.
37- *
38- * @see https://github.com/guanguans/soar-php
39- */
40-
41- // +----------------------------------------------------------------------+//
42- // | 请参考 @see https://github.com/XiaoMi/soar |//
43- // +----------------------------------------------------------------------+//
44-
45- return %s;
46- PHP,
47- var_export (ComposerScripts::resolveSoarHelp ()->map (static fn (array $ help ): mixed => $ help ['default ' ])->all (), true ),
48- )
49- );
50-
5123return RectorConfig::configure ()
5224 ->withPaths ([
53- $ path ,
25+ __DIR__ . ' /examples/soar-options.php ' ,
5426 ])
5527 ->withPhpVersion (PhpVersion::PHP_80 )
5628 ->withoutParallel ()
Original file line number Diff line number Diff line change @@ -75,6 +75,48 @@ public static function dumpSoarYamlConfig(Event $event): int
7575 return 0 ;
7676 }
7777
78+ /**
79+ * @noinspection PhpUnused
80+ * @noinspection DebugFunctionUsageInspection
81+ *
82+ * @throws \Guanguans\SoarPHP\Exceptions\InvalidOptionException
83+ */
84+ public static function dumpSoarPHPConfig (Event $ event ): int
85+ {
86+ self ::requireAutoload ($ event );
87+
88+ file_put_contents (
89+ __DIR__ .'/../../examples/soar-options.php ' ,
90+ \sprintf (
91+ <<<'PHP'
92+ <?php
93+
94+ declare(strict_types=1);
95+
96+ /**
97+ * Copyright (c) 2019-2025 guanguans<ityaozm@gmail.com>
98+ *
99+ * For the full copyright and license information, please view
100+ * the LICENSE file that was distributed with this source code.
101+ *
102+ * @see https://github.com/guanguans/soar-php
103+ */
104+
105+ // +----------------------------------------------------------------------+//
106+ // | 请参考 @see https://github.com/XiaoMi/soar |//
107+ // +----------------------------------------------------------------------+//
108+
109+ return %s;
110+ PHP,
111+ var_export (self ::resolveSoarHelp ()->map (static fn (array $ help ): mixed => $ help ['default ' ])->all (), true ),
112+ )
113+ );
114+
115+ self ::makeSymfonyStyle ()->success ('No errors ' );
116+
117+ return 0 ;
118+ }
119+
78120 /**
79121 * @throws \Guanguans\SoarPHP\Exceptions\InvalidOptionException
80122 */
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public static function isWindows(): bool
4343
4444 public static function isMacOS (): bool
4545 {
46- return str_contains (\ php_uname ('s ' ), 'Darwin ' );
46+ return str_contains (php_uname ('s ' ), 'Darwin ' );
4747 }
4848
4949 public static function isArm (): bool
@@ -78,6 +78,6 @@ public static function getArchEnum(): string
7878
7979 public static function getArch (): string
8080 {
81- return \ php_uname ('m ' );
81+ return php_uname ('m ' );
8282 }
8383}
You can’t perform that action at this time.
0 commit comments