Skip to content

Commit ed284a2

Browse files
authored
Merge pull request #8 from Kdecherf/cs-upstream
Add CS and update to upstream 1.2.6
2 parents 08cb7a1 + 9ce2eef commit ed284a2

File tree

8 files changed

+3518
-911
lines changed

8 files changed

+3518
-911
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
; top-most EditorConfig file
2+
root = true
3+
4+
; Unix-style newlines
5+
[*]
6+
end_of_line = LF
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "CS"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
coding-standards:
11+
name: "CS Fixer"
12+
runs-on: "ubuntu-20.04"
13+
14+
steps:
15+
- name: "Checkout"
16+
uses: "actions/checkout@v2"
17+
18+
- name: "Install PHP"
19+
uses: "shivammathur/setup-php@v2"
20+
with:
21+
coverage: "none"
22+
php-version: "7.4"
23+
tools: cs2pr, pecl, composer:v1
24+
extensions: tidy
25+
ini-values: "date.timezone=Europe/Paris"
26+
env:
27+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: "Install dependencies with Composer"
30+
uses: "ramsey/composer-install@v1"
31+
with:
32+
composer-options: "--optimize-autoloader --prefer-dist"
33+
34+
- name: "RUN PHP CS Fixer"
35+
run: "php vendor/bin/php-cs-fixer fix --verbose --dry-run --format=checkstyle | cs2pr"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/bin/
2+
/vendor/
3+
.php-cs-fixer.cache

.php-cs-fixer.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
4+
$finder = (new PhpCsFixer\Finder())
5+
->in(__DIR__)
6+
->exclude(['vendor', 'log', 'script'])
7+
;
8+
return (new PhpCsFixer\Config())
9+
->setRiskyAllowed(true)
10+
->setRules([
11+
'@Symfony' => true,
12+
'@Symfony:risky' => true,
13+
'array_syntax' => ['syntax' => 'short'],
14+
'combine_consecutive_unsets' => true,
15+
'heredoc_to_nowdoc' => true,
16+
'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']],
17+
'no_unreachable_default_argument_value' => true,
18+
'no_useless_else' => true,
19+
'no_useless_return' => true,
20+
'ordered_class_elements' => true,
21+
'ordered_imports' => true,
22+
'php_unit_strict' => true,
23+
'phpdoc_order' => true,
24+
// 'psr4' => true,
25+
'strict_comparison' => true,
26+
'strict_param' => true,
27+
'concat_space' => ['spacing' => 'one'],
28+
])
29+
->setFinder($finder)
30+
;

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"require":{
1818
"php":">4.4.0"
1919
},
20+
"require-dev": {
21+
"friendsofphp/php-cs-fixer": "^3.0"
22+
},
2023
"replace":{
2124
"htmlawed/htmlawed": "*"
2225
},

0 commit comments

Comments
 (0)