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 164
164
" @composer-normalize" ,
165
165
" @composer-validate" ,
166
166
" @check-soar-binary" ,
167
- " @dump-soar-yaml- config" ,
167
+ " @dump-soar-config" ,
168
168
" @json-lint" ,
169
169
" @md-lint" ,
170
170
" @yaml-lint" ,
191
191
" @dump-soar-yaml-config" ,
192
192
" @dump-soar-php-config"
193
193
],
194
+ "dump-soar-original-php-config" : " Guanguans\\ SoarPHP\\ Support\\ ComposerScripts::dumpSoarPHPConfig" ,
194
195
"dump-soar-php-config" : [
196
+ " @dump-soar-original-php-config" ,
195
197
" @rector-soar-options" ,
196
198
" @style-fix"
197
199
],
Original file line number Diff line number Diff line change 15
15
* @see https://github.com/guanguans/soar-php
16
16
*/
17
17
18
- use Guanguans \SoarPHP \Support \ComposerScripts ;
19
18
use Guanguans \SoarPHP \Support \Rectors \AddSoarOptionsDocCommentRector ;
20
19
use Guanguans \SoarPHP \Support \Rectors \SimplifyListIndexRector ;
21
20
use Rector \Config \RectorConfig ;
22
21
use Rector \ValueObject \PhpVersion ;
23
22
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
-
51
23
return RectorConfig::configure ()
52
24
->withPaths ([
53
- $ path ,
25
+ __DIR__ . ' /examples/soar-options.php ' ,
54
26
])
55
27
->withPhpVersion (PhpVersion::PHP_80 )
56
28
->withoutParallel ()
Original file line number Diff line number Diff line change @@ -75,6 +75,48 @@ public static function dumpSoarYamlConfig(Event $event): int
75
75
return 0 ;
76
76
}
77
77
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
+
78
120
/**
79
121
* @throws \Guanguans\SoarPHP\Exceptions\InvalidOptionException
80
122
*/
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public static function isWindows(): bool
43
43
44
44
public static function isMacOS (): bool
45
45
{
46
- return str_contains (\ php_uname ('s ' ), 'Darwin ' );
46
+ return str_contains (php_uname ('s ' ), 'Darwin ' );
47
47
}
48
48
49
49
public static function isArm (): bool
@@ -78,6 +78,6 @@ public static function getArchEnum(): string
78
78
79
79
public static function getArch (): string
80
80
{
81
- return \ php_uname ('m ' );
81
+ return php_uname ('m ' );
82
82
}
83
83
}
You can’t perform that action at this time.
0 commit comments