Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress

- name: Formatting
run: vendor/bin/php-cs-fixer fix --dry-run --diff

- name: Static analysis
run: vendor/bin/phpstan analyse --no-progress --memory-limit=512M

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.phpunit.result.cache
.phpunit.cache/
.DS_Store
.php-cs-fixer.cache
26 changes: 26 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

/**
* Matches the NimbusCMS core config: conservative, PSR-12-oriented, no
* house-style rewrites. Kept identical so official packages format the same way.
*/
$finder = PhpCsFixer\Finder::create()
->in([__DIR__ . '/src', __DIR__ . '/tests'])
->append([__FILE__]);

return (new PhpCsFixer\Config())
->setRiskyAllowed(false)
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'no_unused_imports' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'single_quote' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'arguments', 'parameters']],
'no_trailing_whitespace' => true,
'no_whitespace_in_blank_line' => true,
'blank_line_after_opening_tag' => true,
])
->setFinder($finder);
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"nimbuscms/nimbus": "dev-main"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.95",
"phpstan/phpstan": "^2.2",
"phpunit/phpunit": "^11.0"
},
Expand Down Expand Up @@ -51,7 +52,9 @@
"check": [
"@analyse",
"@test"
]
],
"format": "php-cs-fixer fix",
"format:check": "php-cs-fixer fix --dry-run --diff"
},
"config": {
"sort-packages": true
Expand Down
Loading