Skip to content

Commit 4002af3

Browse files
committed
ci(config): Update config files
1 parent 0fd6855 commit 4002af3

File tree

8 files changed

+84
-115
lines changed

8 files changed

+84
-115
lines changed

.github/git-commit-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
- The details about what was done in the body of the message.
2020
- Any useful details concerning the change in the body of the message.
2121
- Use a hyphen (-) for the bullet points in the body of the message.
22-
- Use {locale} language to answer..
22+
- Use {locale} language to answer.
2323
- No code blocks.
2424

2525
## Write 1 commit messages that accurately summarizes the changes made in the given `git diff` output, following the best practices listed above and the conventional commit format

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ guanguans ALL=(ALL) NOPASSWD: /Users/guanguans/Documents/develop/soar-php/bin/so
534534
```shell
535535
composer benchmark
536536
composer checks:required
537+
composer php-cs-fixer:fix
537538
composer soar-php:example-run
538539
composer soar-php:example-serve
539540
composer test

composer-bump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ $statusCode = (new SingleCommandApplication)
5656

5757
exit($statusCode);
5858

59-
class ComposerBump
59+
final class ComposerBump
6060
{
6161
private readonly string $composerJsonPath;
6262
private readonly string $composer;

composer.json

Lines changed: 29 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
"ergebnis/composer-normalize": "^2.48",
5252
"ergebnis/license": "^2.7",
5353
"ergebnis/php-cs-fixer-config": "^6.57",
54-
"ergebnis/rector-rules": "^1.7",
54+
"ergebnis/rector-rules": "^1.8",
5555
"fakerphp/faker": "^1.24",
56-
"guanguans/monorepo-builder-worker": "^2.1",
56+
"guanguans/php-cs-fixer-custom-fixers": "^1.0",
5757
"illuminate/support": "^10.49 || ^11.0 || ^12.0",
5858
"mockery/mockery": "^1.6",
5959
"nette/utils": "^4.0",
@@ -76,7 +76,7 @@
7676
"shipmonk/composer-dependency-analyser": "^1.8",
7777
"shipmonk/dead-code-detector": "^0.14",
7878
"shipmonk/name-collision-detector": "^2.1",
79-
"shipmonk/phpstan-baseline-per-identifier": "^2.2",
79+
"shipmonk/phpstan-baseline-per-identifier": "^2.3",
8080
"spatie/pest-plugin-snapshots": "^2.2",
8181
"spaze/phpstan-disallowed-calls": "^4.7",
8282
"staabm/phpstan-todo-by": "^0.3",
@@ -85,12 +85,11 @@
8585
"symplify/phpstan-rules": "^14.9",
8686
"tomasvotruba/class-leak": "^2.1",
8787
"tomasvotruba/cognitive-complexity": "^1.0",
88-
"tomasvotruba/type-coverage": "^2.0",
88+
"tomasvotruba/type-coverage": "^2.1",
8989
"yamadashy/phpstan-friendly-formatter": "^1.3"
9090
},
9191
"conflict": {
92-
"pestphp/pest": "^4.0",
93-
"symplify/monorepo-builder": "^12.0"
92+
"pestphp/pest": "^4.0"
9493
},
9594
"suggest": {
9695
"symfony/var-dumper": "Required to use the the trait [WithDumpable]."
@@ -162,22 +161,11 @@
162161
"@cghooks:upsert",
163162
"@composer:normalize"
164163
],
165-
"actionlint": [
166-
"if ! command -v actionlint >/dev/null 2>&1; then echo 'actionlint not found, installing...'; brew install actionlint; fi",
167-
"actionlint -ignore=SC2035 -ignore=SC2086 -color -oneline -verbose"
168-
],
164+
"actionlint": "actionlint -ignore=SC2035 -ignore=SC2086 -color -oneline -verbose",
169165
"blade-formatter": "blade-formatter resources/views/*.blade.php resources/views/**/*.blade.php --ignore-path= --php-version=8.1 --progress",
170166
"blade-formatter:check-formatted": "@blade-formatter --check-formatted",
171167
"blade-formatter:write": "@blade-formatter --write",
172168
"cghooks": "@php vendor/bin/cghooks --ansi -vv",
173-
"cghooks:remove": [
174-
"@php -r \"file_exists('.git/hooks/post-merge') and rename('.git/hooks/post-merge', '.git/hooks/post-merge.sample');\"",
175-
"@php -r \"file_exists('.git/hooks/pre-commit') and rename('.git/hooks/pre-commit', '.git/hooks/pre-commit.sample');\""
176-
],
177-
"cghooks:try": [
178-
"@putenv:php",
179-
"[ ! -f \"vendor/bin/cghooks\" ] && exit 0 || $PHP81 vendor/bin/cghooks --ansi -vv"
180-
],
181169
"cghooks:upsert": [
182170
"@cghooks add --ignore-lock",
183171
"@cghooks update"
@@ -189,17 +177,25 @@
189177
"checks:optional": [
190178
"@putenv:xdebug-off",
191179
"@class-leak:check",
180+
"@composer-dependency-analyser",
181+
"@composer:normalize-dry-run",
192182
"@detect-collisions",
183+
"@jack:breakpoint",
193184
"@jack:open-versions-dry-run",
194185
"@jack:raise-to-installed-dry-run",
195186
"@jsonlint",
196187
"@phpmnd",
188+
"@phpstan:analyse",
189+
"@rector:process-dry-run",
197190
"@sk:check-commented-code",
198191
"@sk:check-conflicts",
199192
"@sk:find-multi-classes",
200193
"@sk:namespace-to-psr-4",
201194
"@sk:privatize-constants",
202195
"@sk:spot-lazy-traits",
196+
"@soar-php:check-binary",
197+
"@soar-php:dump-config",
198+
"@soar-php:example-run",
203199
"@todo-lint",
204200
"@yaml-lint",
205201
"@actionlint",
@@ -211,18 +207,11 @@
211207
],
212208
"checks:required": [
213209
"@putenv:xdebug-off",
214-
"@composer:normalize-dry-run",
215-
"@composer-dependency-analyser",
216-
"@php-cs-fixer:fix-dry-run-stop-on-violation",
217-
"@soar-php:check-binary",
218-
"@soar-php:dump-config",
219-
"@soar-php:example-run",
220-
"@pest:bail",
221-
"@rector:process-dry-run",
222-
"@phpstan:analyse"
210+
"@php-cs-fixer:fix-dry-run",
211+
"@pest"
223212
],
224213
"class-leak": "@php vendor/bin/class-leak --ansi -vv",
225-
"class-leak:check": "@class-leak check examples/ src/ --skip-type=\\Contracts\\Channel --skip-suffix=Channel --skip-path=Support/Rectors/",
214+
"class-leak:check": "@class-leak check examples/ src/ --skip-path=Support/Rectors/",
226215
"composer-bump": [
227216
"@putenv:php",
228217
"@composer-config:disable-process-timeout",
@@ -263,7 +252,7 @@
263252
"$PHP82 vendor/bin/grumphp run --ansi -vv"
264253
],
265254
"jack": "@php vendor/bin/jack --ansi -vv",
266-
"jack:breakpoint": "@jack breakpoint --limit=5",
255+
"jack:breakpoint": "@jack breakpoint --limit=7",
267256
"jack:breakpoint-dev": "@jack:breakpoint --dev",
268257
"jack:open-versions": "@jack open-versions --limit=99",
269258
"jack:open-versions-dev": "@jack:open-versions --dev",
@@ -287,7 +276,10 @@
287276
"mago:lint-dry-run": "@mago:lint --dry-run",
288277
"mago:lint-list-rules": "@mago lint --list-rules",
289278
"mago:lint-semantics-only": "@mago lint --semantics-only",
290-
"monorepo-builder": "@php vendor/bin/monorepo-builder --ansi -vv",
279+
"monorepo-builder": [
280+
"@putenv:php",
281+
"$PHP82 vendor/bin/monorepo-builder --ansi -vv"
282+
],
291283
"monorepo-builder:release": "@monorepo-builder release",
292284
"monorepo-builder:release-1.0.0-BETA1": "@monorepo-builder:release 1.0.0-BETA1",
293285
"monorepo-builder:release-1.0.0-BETA1-dry-run": "@monorepo-builder:release-1.0.0-BETA1 --dry-run",
@@ -309,10 +301,7 @@
309301
"@php vendor/bin/pest --colors=always --min=80 --coverage --profile",
310302
"@putenv:xdebug-off"
311303
],
312-
"pest:bail": "@pest --bail",
313-
"pest:compact": "@pest --compact",
314304
"pest:coverage": "@pest --coverage-html=.build/phpunit/ --coverage-clover=.build/phpunit/clover.xml",
315-
"pest:disable-coverage-ignore": "@pest --disable-coverage-ignore",
316305
"pest:highest": [
317306
"@putenv:php",
318307
"@putenv:xdebug-on",
@@ -326,11 +315,13 @@
326315
"pest:type-coverage": "@pest --type-coverage",
327316
"pest:update-snapshots": "@pest --update-snapshots",
328317
"php-cs-fixer": "@php vendor/bin/php-cs-fixer --ansi -vv",
329-
"php-cs-fixer:check": "@php-cs-fixer check --show-progress=dots --diff",
330-
"php-cs-fixer:describe": "@php-cs-fixer describe",
318+
"php-cs-fixer:custom": "@php-cs-fixer --config=.php-cs-fixer-custom.php",
319+
"php-cs-fixer:custom-check": "@php-cs-fixer:custom check --show-progress=dots --diff",
320+
"php-cs-fixer:custom-fix": "@php-cs-fixer:custom fix --show-progress=dots --diff",
321+
"php-cs-fixer:custom-fix-dry-run": "@php-cs-fixer:custom-fix --dry-run",
322+
"php-cs-fixer:custom-list-files": "@php-cs-fixer:custom list-files",
331323
"php-cs-fixer:fix": "@php-cs-fixer fix --show-progress=dots --diff",
332324
"php-cs-fixer:fix-dry-run": "@php-cs-fixer:fix --dry-run",
333-
"php-cs-fixer:fix-dry-run-stop-on-violation": "@php-cs-fixer:fix-dry-run --stop-on-violation",
334325
"php-cs-fixer:list-files": "@php-cs-fixer list-files",
335326
"php-cs-fixer:list-sets": "@php-cs-fixer list-sets --ansi -vv",
336327
"php-lint": [
@@ -339,14 +330,9 @@
339330
"for DIR in src/ tests/; do find $DIR -type f -name '*.php' -type f ! -name 'xxx.php' -exec $PHP81 -l {} \\; 2>&1 | (! grep -v '^No syntax errors detected'); done"
340331
],
341332
"phpbench": "@php vendor/bin/phpbench run --report=aggregate --ansi -vv",
342-
"phpcs": "@php vendor/bin/phpcs examples/ src/ --extensions=php --ignore=*/vendor/* --parallel=8 --cache --colors -n -p -s -v",
343-
"phpcs:compatibility": "@phpcs --standard=PHPCompatibility --exclude=PHPCompatibility.FunctionDeclarations.NewClosure --runtime-set testVersion 8.5-",
344-
"phpcs:help": "@phpcs --help",
345-
"phpcs:i": "@phpcs -i",
346333
"phpmnd": "@php vendor/bin/phpmnd src/ --exclude-path=Support/helpers.phpp --ignore-numbers=2,-1 --hint --progress --ansi -vv",
347334
"phpstan": "@php vendor/bin/phpstan --ansi -vv",
348335
"phpstan:analyse": "@phpstan analyse",
349-
"phpstan:analyse-fix": "@phpstan:analyse --fix",
350336
"phpstan:analyse-generate-baseline": "@phpstan:analyse --generate-baseline --allow-empty-baseline",
351337
"phpstan:analyse-split-baseline": [
352338
"@phpstan:analyse --generate-baseline=baselines/loader.neon --allow-empty-baseline",
@@ -359,10 +345,6 @@
359345
"@putenv:xdebug-off",
360346
"@php vendor/bin/pint --ansi -vv"
361347
],
362-
"pint:bail": "@pint --bail",
363-
"pint:dirty": "@pint --dirty",
364-
"pint:dirty-bail": "@pint:dirty --bail",
365-
"pint:dirty-test": "@pint:dirty --test",
366348
"pint:test": "@pint --test",
367349
"putenv:composer-memory-unlimited": "@putenv COMPOSER_MEMORY_LIMIT=-1",
368350
"putenv:php": [
@@ -379,7 +361,6 @@
379361
"@putenv XDEBUG_MODE=coverage,debug",
380362
"@putenv XDEBUG_SESSION=1"
381363
],
382-
"readme-lint": "@php readme-lint --ansi -vv",
383364
"rector": "@php vendor/bin/rector",
384365
"rector:custom-rule": "@rector custom-rule",
385366
"rector:list-rules": "@rector list-rules",
@@ -391,7 +372,6 @@
391372
"rector:process-only-dry-run": "@rector:process-only --dry-run",
392373
"rector:process-options": "@rector:process-clear-cache --config=rector-options.php",
393374
"rector:process-options-dry-run": "@rector:process-options --dry-run",
394-
"rector:setup-ci": "@rector setup-ci",
395375
"rule-doc-generator": [
396376
"@putenv:php",
397377
"$PHP82 rule-doc-generator --ansi -vv"
@@ -457,15 +437,6 @@
457437
],
458438
"todo-lint": "! git --no-pager grep --extended-regexp --ignore-case 'todo|fixme' -- '*.php' ':!*.blade.php' ':(exclude)resources/'",
459439
"trufflehog": "trufflehog git https://github.com/guanguans/soar-php --only-verified",
460-
"user:composer": [
461-
"@putenv:composer-memory-unlimited",
462-
"@putenv:xdebug-off",
463-
"@composer --ansi -vv"
464-
],
465-
"user:php": [
466-
"@putenv:xdebug-off",
467-
"@php -d xdebug.mode=off"
468-
],
469440
"var-dump-server:cli": "@php vendor/bin/var-dump-server --ansi -vv",
470441
"var-dump-server:html": [
471442
"@composer-config:disable-process-timeout",
@@ -475,22 +446,15 @@
475446
"@php vendor/bin/var-dump-server --ansi -v --format=html > .build/dump.html"
476447
],
477448
"vendor-patches": "@php vendor/bin/vendor-patches generate --ansi -vv",
478-
"vhs": [
479-
"@cghooks:remove",
480-
"vhs < soar-php.tape",
481-
"@cghooks:upsert"
482-
],
449+
"vhs": "vhs < soar-php.tape",
483450
"yaml-lint": "@php vendor/bin/yaml-lint .github/ examples/ --ansi -vv",
484451
"zhlint": [
485452
"if ! command -v zhlint >/dev/null 2>&1; then echo 'zhlint not found, installing...'; npm install -g zhlint; fi",
486453
"@zhlint:prototype"
487454
],
488455
"zhlint:fix": "@zhlint:prototype --fix",
489456
"zhlint:prototype": "zhlint {,docs/,docs/**/}*-zh_CN.md",
490-
"zizmor": [
491-
"if ! command -v zizmor >/dev/null 2>&1; then echo 'zizmor not found, installing...'; brew install zizmor; fi",
492-
"zizmor .github/ --verbose"
493-
]
457+
"zizmor": "zizmor .github/ --verbose"
494458
},
495459
"scripts-aliases": {
496460
"pest": [

rector.php

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,22 @@
108108
StaticArrowFunctionRector::class,
109109
StaticClosureRector::class,
110110
])
111-
->withConfiguredRule(AddNoinspectionsDocCommentToDeclareRector::class, [
112-
'AnonymousFunctionStaticInspection',
113-
'NullPointerExceptionInspection',
114-
'PhpPossiblePolymorphicInvocationInspection',
115-
'PhpUndefinedClassInspection',
116-
'PhpUnhandledExceptionInspection',
117-
'PhpVoidFunctionResultUsedInspection',
118-
'SqlResolve',
119-
'StaticClosureCanBeUsedInspection',
120-
])
121-
->withConfiguredRule(NewExceptionToNewAnonymousExtendsExceptionImplementsRector::class, [
122-
Throwable::class,
123-
])
124-
->withConfiguredRule(RemoveNamespaceRector::class, [
125-
'Guanguans\SoarPHPTests',
126-
])
111+
// ->withConfiguredRule(AddNoinspectionsDocCommentToDeclareRector::class, [
112+
// 'AnonymousFunctionStaticInspection',
113+
// 'NullPointerExceptionInspection',
114+
// 'PhpPossiblePolymorphicInvocationInspection',
115+
// 'PhpUndefinedClassInspection',
116+
// 'PhpUnhandledExceptionInspection',
117+
// 'PhpVoidFunctionResultUsedInspection',
118+
// 'SqlResolve',
119+
// 'StaticClosureCanBeUsedInspection',
120+
// ])
121+
// ->withConfiguredRule(NewExceptionToNewAnonymousExtendsExceptionImplementsRector::class, [
122+
// Throwable::class,
123+
// ])
124+
// ->withConfiguredRule(RemoveNamespaceRector::class, [
125+
// 'Guanguans\SoarPHPTests',
126+
// ])
127127
->withConfiguredRule(RemoveAnnotationRector::class, [
128128
'codeCoverageIgnore',
129129
'inheritDoc',
@@ -209,34 +209,34 @@ static function (array $carry, string $func): array {
209209
__DIR__.'/tests/',
210210
__FILE__,
211211
],
212-
AddNoinspectionsDocCommentToDeclareRector::class => [
213-
__DIR__.'/benchmarks/',
214-
__DIR__.'/examples/',
215-
__DIR__.'/src/',
216-
// __DIR__.'/tests/',
217-
...$rootFiles = array_filter(
218-
glob(__DIR__.'/{*,.*}.php', \GLOB_BRACE),
219-
static fn (string $filename): bool => !\in_array(
220-
$filename,
221-
[
222-
__DIR__.'/_ide_helper.php',
223-
__DIR__.'/tests.php',
224-
],
225-
true
226-
)
227-
),
228-
__DIR__.'/composer-bump',
229-
],
230-
NewExceptionToNewAnonymousExtendsExceptionImplementsRector::class => [
231-
__DIR__.'/src/Support/Rectors/',
232-
],
233-
RemoveNamespaceRector::class => [
234-
__DIR__.'/benchmarks/',
235-
__DIR__.'/examples/',
236-
__DIR__.'/src/',
237-
// __DIR__.'/tests/',
238-
...$rootFiles,
239-
__DIR__.'/composer-bump',
240-
__DIR__.'/tests/TestCase.php',
241-
],
212+
// AddNoinspectionsDocCommentToDeclareRector::class => [
213+
// __DIR__.'/benchmarks/',
214+
// __DIR__.'/examples/',
215+
// __DIR__.'/src/',
216+
// // __DIR__.'/tests/',
217+
// ...$rootFiles = array_filter(
218+
// glob(__DIR__.'/{*,.*}.php', \GLOB_BRACE),
219+
// static fn (string $filename): bool => !\in_array(
220+
// $filename,
221+
// [
222+
// __DIR__.'/_ide_helper.php',
223+
// __DIR__.'/tests.php',
224+
// ],
225+
// true
226+
// )
227+
// ),
228+
// __DIR__.'/composer-bump',
229+
// ],
230+
// NewExceptionToNewAnonymousExtendsExceptionImplementsRector::class => [
231+
// __DIR__.'/src/Support/Rectors/',
232+
// ],
233+
// RemoveNamespaceRector::class => [
234+
// __DIR__.'/benchmarks/',
235+
// __DIR__.'/examples/',
236+
// __DIR__.'/src/',
237+
// // __DIR__.'/tests/',
238+
// ...$rootFiles,
239+
// __DIR__.'/composer-bump',
240+
// __DIR__.'/tests/TestCase.php',
241+
// ],
242242
]);

src/Support/helpers.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
function classes(?callable $filter = null): Collection
4545
{
4646
static $classes;
47-
4847
$classes ??= collect(spl_autoload_functions())->flatMap(
4948
static fn (mixed $loader): array => \is_array($loader) && $loader[0] instanceof ClassLoader
5049
? $loader[0]->getClassMap()

tests/Pest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*/
2323

2424
use Faker\Factory;
25+
use Faker\Generator;
2526
use Guanguans\SoarPHPTests\TestCase;
2627
use Pest\Expectation;
2728

0 commit comments

Comments
 (0)