Skip to content

Commit 2477279

Browse files
Merge pull request #26 from TheDragonCode/1.x
Bump codestyler
2 parents cf282a9 + 0be5494 commit 2477279

4 files changed

Lines changed: 93 additions & 17 deletions

File tree

.github/workflows/code-style.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,12 @@ permissions: write-all
88

99
jobs:
1010
check:
11-
if: ${{ ! (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
12-
1311
runs-on: ubuntu-latest
1412

1513
steps:
1614
- name: Checkout code
1715
uses: actions/checkout@v4
1816

1917
- name: Checking PHP Syntax
20-
uses: TheDragonCode/codestyler@v5
18+
run: vendor/bin/pint --test
2119

22-
fix:
23-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
24-
25-
runs-on: ubuntu-latest
26-
27-
steps:
28-
- name: Checkout code
29-
uses: actions/checkout@v4
30-
31-
- name: Checking PHP Syntax
32-
uses: TheDragonCode/codestyler@v5
33-
with:
34-
github_token: ${{ secrets.COMPOSER_TOKEN }}
35-
fix: true

composer.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"illuminate/collections": "^8.75 || ^9.0 || ^10.0 || ^11.0 || ^12.0"
4242
},
4343
"require-dev": {
44+
"dragon-code/codestyler": "^6.0",
4445
"fakerphp/faker": "^1.21",
4546
"illuminate/database": "^8.75 || ^9.0 || ^10.0 || ^11.0 || ^12.0",
4647
"phpunit/phpunit": "^9.6 || ^10.0 || ^11.0 || ^12.0",
@@ -67,5 +68,13 @@
6768
},
6869
"preferred-install": "dist",
6970
"sort-packages": true
71+
},
72+
"scripts": {
73+
"post-update-cmd": [
74+
"cp vendor/dragon-code/codestyler/presets/pint/8.2.json pint.json",
75+
"cp vendor/dragon-code/codestyler/.editorconfig .editorconfig",
76+
"composer normalize"
77+
],
78+
"style": "vendor/bin/pint --parallel"
7079
}
7180
}

pint.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"preset": "laravel",
3+
"rules": {
4+
"@PHP71Migration": true,
5+
"@PHP73Migration": true,
6+
"@PHP74Migration": true,
7+
"@PHP80Migration": true,
8+
"@PHP81Migration": true,
9+
"@PHP82Migration": true,
10+
"concat_space": {
11+
"spacing": "one"
12+
},
13+
"blank_line_before_statement": {
14+
"statements": [
15+
"declare",
16+
"phpdoc",
17+
"continue",
18+
"return"
19+
]
20+
},
21+
"class_attributes_separation": {
22+
"elements": {
23+
"case": "none",
24+
"const": "none",
25+
"method": "one",
26+
"property": "one",
27+
"trait_import": "none"
28+
}
29+
},
30+
"class_definition": {
31+
"multi_line_extends_each_single_line": true,
32+
"single_item_single_line": true,
33+
"single_line": true,
34+
"space_before_parenthesis": true
35+
},
36+
"combine_consecutive_issets": true,
37+
"combine_consecutive_unsets": true,
38+
"braces_position": {
39+
"allow_single_line_anonymous_functions": true,
40+
"allow_single_line_empty_anonymous_classes": true,
41+
"anonymous_classes_opening_brace": "same_line"
42+
},
43+
"escape_implicit_backslashes": {
44+
"double_quoted": true,
45+
"heredoc_syntax": true,
46+
"single_quoted": false
47+
},
48+
"global_namespace_import": {
49+
"import_classes": true,
50+
"import_constants": true,
51+
"import_functions": true
52+
},
53+
"multiline_comment_opening_closing": true,
54+
"no_superfluous_elseif": true,
55+
"no_useless_else": true,
56+
"operator_linebreak": {
57+
"only_booleans": false
58+
},
59+
"ordered_types": {
60+
"null_adjustment": "always_last",
61+
"sort_algorithm": "alpha"
62+
},
63+
"phpdoc_line_span": {
64+
"const": "single",
65+
"method": "multi",
66+
"property": "single"
67+
},
68+
"return_assignment": true,
69+
"simplified_if_return": true,
70+
"phpdoc_param_order": true,
71+
"fully_qualified_strict_types": true,
72+
"declare_strict_types": true,
73+
"types_spaces": {
74+
"space_multiple_catch": "none"
75+
},
76+
"binary_operator_spaces": {
77+
"default": "align_single_space_minimal"
78+
},
79+
"php_unit_method_casing": {
80+
"case": "camel_case"
81+
}
82+
}
83+
}

0 commit comments

Comments
 (0)