Skip to content

Commit 19333a5

Browse files
committed
Remove deprecations
1 parent ddeb305 commit 19333a5

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

.github/workflows/ci.yml

+6-13
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,27 @@ jobs:
88
fail-fast: false
99
matrix:
1010
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
11-
php-version: ['7.2', '7.3', '7.4', '8.0']
11+
php-version: ['8.0', '8.1', '8.2', '8.3']
1212
runs-on: ${{ matrix.operating-system }}
1313
steps:
1414
- name: Fix autocrlf on Windows
1515
if: matrix.operating-system == 'windows-latest'
1616
run: git config --global core.autocrlf false
1717
- name: Checkout
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
1919
- name: Setup PHP
2020
uses: shivammathur/setup-php@v2
2121
with:
2222
php-version: ${{ matrix.php-version }}
2323
coverage: none
24-
- name: Get composer cache directory
25-
id: composer-cache
26-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
27-
- name: Cache composer dependencies
28-
uses: actions/cache@v2
24+
- name: Install composer dependencies
25+
uses: ramsey/composer-install@v3
2926
with:
30-
path: ${{ steps.composer-cache.outputs.dir }}
31-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
32-
restore-keys: ${{ runner.os }}-composer-
33-
- name: Install dependencies
34-
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
27+
composer-options: "--prefer-dist --optimize-autoloader"
3528
- name: Create .php-cs-fixer.php
3629
if: matrix.operating-system != 'windows-latest'
3730
run: echo "<?php \$config = new phootwork\fixer\Config();\$config->getFinder()->in(__DIR__.'/src');return \$config;" > .php-cs-fixer.php
38-
- name: Create .php-cs-fixer.phpon Windows
31+
- name: Create .php-cs-fixer.php on Windows
3932
if: matrix.operating-system == 'windows-latest'
4033
run: |
4134
New-Item .php-cs-fixer.php

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
},
1919
"require" : {
20-
"php" : ">=7.2",
20+
"php" : ">=8.0",
2121
"friendsofphp/php-cs-fixer" : "^3"
2222
}
2323
}

src/Config.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ public function getRules(): array {
2626
'blank_line_before_statement' => [
2727
'statements' => ['return', 'throw', 'try', 'exit']
2828
],
29-
'braces' => [
30-
'position_after_functions_and_oop_constructs' => 'same'
29+
'braces_position' => [
30+
'classes_opening_brace' => 'same_line',
31+
'functions_opening_brace' => 'same_line'
3132
],
3233
'cast_spaces' => [
3334
'space' => 'single'
3435
],
35-
'compact_nullable_typehint' => true,
36+
'compact_nullable_type_declaration' => true,
3637
'concat_space' => [
3738
'spacing' => 'one'
3839
],
@@ -46,7 +47,6 @@ public function getRules(): array {
4647
'function_declaration' => [
4748
'closure_function_spacing' => 'one'
4849
],
49-
'function_typehint_space' => true,
5050
'indentation_type' => true,
5151
'lowercase_cast' => true,
5252
'lowercase_keywords' => true,
@@ -62,8 +62,7 @@ public function getRules(): array {
6262
'no_leading_namespace_whitespace' => true,
6363
'no_multiline_whitespace_around_double_arrow' => true,
6464
'no_spaces_after_function_name' => true,
65-
'no_spaces_inside_parenthesis' => true,
66-
'no_trailing_comma_in_singleline_array' => true,
65+
'no_trailing_comma_in_singleline' => ['elements' => ['arguments', 'array_destructuring', 'array', 'group_import']],
6766
'no_trailing_whitespace' => true,
6867
'no_unused_imports' => true,
6968
'no_whitespace_before_comma_in_array' => true,
@@ -81,6 +80,8 @@ public function getRules(): array {
8180
'single_import_per_statement' => true,
8281
'single_line_after_imports' => true,
8382
'single_quote' => true,
83+
'spaces_inside_parentheses' => ['space' => 'none'],
84+
'type_declaration_spaces' => ['elements' => ['function', 'property']],
8485
'visibility_required' => true,
8586
'whitespace_after_comma_in_array' => true
8687
];

0 commit comments

Comments
 (0)