Skip to content

Commit d61e3ac

Browse files
committed
Add support for PHP 8.2
1 parent 55a92ba commit d61e3ac

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

.github/workflows/composer-json-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
php-version:
16-
- "7.4"
16+
- "8.2"
1717
operating-system:
1818
- "ubuntu-latest"
1919

.github/workflows/php-cs-fixer.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ jobs:
1313
strategy:
1414
matrix:
1515
php-version:
16-
- "7.1"
17-
- "7.2"
18-
- "7.3"
1916
- "7.4"
2017
- "8.0"
2118
- "8.1"
19+
- "8.2"
2220
operating-system:
2321
- "ubuntu-latest"
2422

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ This package makes use of PHP-CS-Fixer.
1414
This package provides default rules to be used with PHP-CS-Fixer.
1515

1616
You can find them in `Mollie\PhpCodingStandards\PhpCsFixer\Rules` which has methods specific to php version,
17-
which you can directly use in the `->setRules()` part of your config. For example, assuming PHP version 7.3:
17+
which you can directly use in the `->setRules()` part of your config. For example, assuming PHP version 8.2:
1818

1919
```php
2020
use Mollie\PhpCodingStandards\PhpCsFixer\Rules;
2121

22-
$config->setRules(Rules::getForPhp73());
22+
$config->setRules(Rules::getForPhp82());
2323
```
2424

2525
### New to PHP-CS-Fixer
@@ -39,8 +39,8 @@ $finder = Finder::create()
3939
return (new Config())
4040
->setFinder($finder)
4141
->setRiskyAllowed(true)
42-
// use specific rules for your php version e.g.: getForPhp71, getForPhp72, getForPhp73
43-
->setRules(Rules::getForPhp71());
42+
// use specific rules for your php version e.g.: getForPhp74, getForPhp80, getForPhp81
43+
->setRules(Rules::getForPhp74());
4444
```
4545

4646
### Manual Triggering
@@ -90,4 +90,4 @@ strong opinions, and, most importantly, who know how to ship great products. Wan
9090

9191
## License
9292
[BSD (Berkeley Software Distribution) License](https://opensource.org/licenses/bsd-license.php).
93-
Copyright (c) 2019, Mollie B.V.
93+
Copyright (c) 2023, Mollie B.V.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": "^7.1.3 || ^8.0",
14-
"friendsofphp/php-cs-fixer": "^3.1.0"
14+
"friendsofphp/php-cs-fixer": "^3.15"
1515
},
1616
"minimum-stability": "stable",
1717
"autoload": {

src/PhpCsFixer/Rules.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Mollie\PhpCodingStandards\PhpCsFixer;
66

77
/*
8-
* Last updated for php-cs-fixer version: 2.16
8+
* Last updated for php-cs-fixer version: 3.15.1
99
*/
1010
class Rules
1111
{
@@ -75,6 +75,15 @@ public static function getForPhp81(array $overriddenRules = []): array
7575
return array_merge(self::getForPhp80($specific81Rules), $overriddenRules);
7676
}
7777

78+
public static function getForPhp82(array $overriddenRules = []): array
79+
{
80+
$specific82Rules = [
81+
// At the moment there are no specific 8.2 rules or configurations
82+
];
83+
84+
return array_merge(self::getForPhp81($specific82Rules), $overriddenRules);
85+
}
86+
7887
private static function getBaseRules(): array
7988
{
8089
return [

0 commit comments

Comments
 (0)