Skip to content
Closed
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
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
; top-most EditorConfig file
root = true

; Unix-style newlines
[*]
charset = utf-8
end_of_line = LF
insert_final_newline = true
trim_trailing_whitespace = true

[*.{php,html,twig}]
indent_style = space
indent_size = 4

[*.md]
max_line_length = 80

[COMMIT_EDITMSG]
max_line_length = 0
6 changes: 6 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,11 @@ jobs:
- name: Composer install
run: composer install --no-progress

- name: Run PHP-CS-Fixer
run: vendor/bin/php-cs-fixer fix -v --dry-run --stop-on-violation --using-cache=no

- name: Run PHPStan
run: vendor/bin/phpstan analyse --no-progress --error-format=github

- name: Run PHPUnit
run: vendor/bin/phpunit
38 changes: 38 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;

if (!file_exists(__DIR__ . '/src') || !file_exists(__DIR__ . '/tests')) {
exit(0);
}

return (new Config())
// @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7777
->setParallelConfig(ParallelConfigFactory::detect())
->setRules([
'@PHP71Migration' => true,
'@PHPUnit75Migration:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'protected_to_private' => false,
'phpdoc_annotation_without_dot' => false,
'increment_style' => [
'style' => 'post',
],
'phpdoc_types_order' => [
'null_adjustment' => 'always_first',
],
'concat_space' => [
'spacing' => 'one',
],
])
->setRiskyAllowed(true)
->setFinder(
(new Finder())
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
->append([__FILE__])
)
->setCacheFile('.php-cs-fixer.cache');
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
}
],
"require": {
"php": ">=7.4",
"php": ">=8.1",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^11.5",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/extension-installer": "^1.4"
"phpstan/extension-installer": "^1.4",
"friendsofphp/php-cs-fixer": "^3.72"
},
"config": {
"allow-plugins": {
Expand Down
Loading