Skip to content

Commit eb164d9

Browse files
Merge pull request #237 from TheDragonCode/5.x
Added PHP 8.4 support
2 parents 8990c82 + 68524e8 commit eb164d9

File tree

15 files changed

+1492
-960
lines changed

15 files changed

+1492
-960
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Setup PHP
3131
uses: shivammathur/setup-php@v2
3232
with:
33-
php-version: 8.1
33+
php-version: 8.2
3434
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json, dom, curl, libxml, fileinfo, tokenizer, xml
3535
ini-values: error_reporting=E_ALL
3636
coverage: none
@@ -60,7 +60,7 @@ jobs:
6060
fail-fast: true
6161
matrix:
6262
os: [ "ubuntu-latest", "windows-latest" ]
63-
php: [ "8.1", "8.2", "8.3" ]
63+
php: [ "8.2", "8.3", "8.4" ]
6464

6565
name: check on ${{ matrix.os }} with PHP ${{ matrix.php }}
6666

.github/workflows/publish-phar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Setup PHP
3434
uses: shivammathur/setup-php@v2
3535
with:
36-
php-version: 8.1
36+
php-version: 8.2
3737
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json, dom, curl, libxml, fileinfo, tokenizer, xml
3838
ini-values: error_reporting=E_ALL
3939
coverage: none

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: true
1616
matrix:
1717
os: [ "ubuntu-latest", "windows-latest" ]
18-
php: [ "8.1", "8.2", "8.3" ]
18+
php: [ "8.2", "8.3", "8.4" ]
1919

2020
name: PHP ${{ matrix.php }} - ${{ matrix.os }}
2121

README.md

Lines changed: 6 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ and [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer), and makes it s
1515
stays clean and consistent.
1616

1717
By default, `Codestyler` does not require any configuration and will fix code style issues in your code by following
18-
the opinionated coding style of `The Dragon Code` based on the [`PER`](https://www.php-fig.org/per/coding-style/) rule
18+
the opinionated coding style of `The Dragon Code` based on the [`PER-2.0`](https://www.php-fig.org/per/coding-style/) rule
1919
set.
2020

2121

@@ -29,8 +29,10 @@ set.
2929

3030
### Required
3131

32-
- PHP: ^8.1
33-
- Composer: ^2.0
32+
| Package | PHP |
33+
|---------|-----------|
34+
| `^5.0` | 8.2 - 8.4 |
35+
| `^4.0` | 8.1 - 8.3 |
3436

3537
### Locally
3638

@@ -160,136 +162,7 @@ codestyle dependabot --help
160162
codestyle editorconfig --help
161163
```
162164

163-
### GitHub Action
164-
165-
> ATTENTION
166-
>
167-
> Starting with code styler version 4.2.0, we will no longer support
168-
> a [container](https://github.com/marketplace/actions/the-dragon-code-styler) for GitHub Actions.
169-
>
170-
> Instead, use direct dependency installation using the examples below.
171-
172-
Create a new `.github/workflows/code-style.yml` file and add the content to it:
173-
174-
```yaml
175-
name: Code Style
176-
177-
on: [ push, pull_request ]
178-
179-
permissions: write-all
180-
181-
jobs:
182-
check:
183-
runs-on: ubuntu-latest
184-
185-
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/main' }}
186-
187-
steps:
188-
- name: Checkout code
189-
uses: actions/checkout@v4
190-
191-
- name: Setup PHP
192-
uses: shivammathur/setup-php@v2
193-
with:
194-
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json
195-
coverage: none
196-
197-
- name: Install dependency
198-
run: composer global require dragon-code/codestyler
199-
200-
- name: Check the code-style
201-
run: codestyle --test
202-
203-
fix:
204-
runs-on: ubuntu-latest
205-
206-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
207-
208-
steps:
209-
- name: Checkout code
210-
uses: actions/checkout@v4
211-
212-
- name: Setup PHP
213-
uses: shivammathur/setup-php@v2
214-
with:
215-
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json
216-
coverage: none
217-
218-
- name: Setup Composer
219-
run: |
220-
composer global config --no-plugins allow-plugins.dragon-code/codestyler true
221-
composer global config --no-plugins allow-plugins.ergebnis/composer-normalize true
222-
223-
composer config --no-plugins allow-plugins.dragon-code/codestyler true
224-
composer config --no-plugins allow-plugins.ergebnis/composer-normalize true
225-
226-
- name: Install dependencies
227-
run: |
228-
composer global require dragon-code/codestyler
229-
composer global require ergebnis/composer-normalize
230-
231-
- name: Fix the code-style
232-
run: |
233-
# Copies the `.editorconfig` file to the folder from which the command is run.
234-
# The file contains a complete set of instructions for the IDE that supports EditorConfig.
235-
codestyle editorconfig
236-
237-
# Copies the `The_Dragon_Code_phpStorm.xml` file to the folder from which the command is run.
238-
# The file contains a complete set of instructions for JetBrains PhpStorm.
239-
codestyle phpstorm
240-
241-
# Creates or updates the `dependabot.yml` file for GitHub Actions.
242-
codestyle dependabot
243-
244-
# The main script for fixing the project code style
245-
codestyle
246-
247-
# Provides a composer plugin for normalizing `composer.json`.
248-
composer normalize
249-
250-
- name: Create a Pull Request
251-
uses: peter-evans/create-pull-request@v6
252-
with:
253-
branch: code-style
254-
branch-suffix: random
255-
delete-branch: true
256-
title: "🦋 The code style has been fixed"
257-
commit-message: 🦋 The code style has been fixed
258-
body: The code style has been fixed
259-
labels: code-style
260-
```
261-
262-
You can also use a simplified version of the configuration by linking to our settings.
263-
264-
In this case, the following settings will be applied:
265-
266-
- Always checks if the event is not equal to `push` or the branch is not equal to `main`
267-
- Correcting the code style will take the following steps:
268-
- Will add the following plugins to the list
269-
of [allowed plugins](https://getcomposer.org/doc/06-config.md#allow-plugins)
270-
in your `composer.json` file:
271-
- `dragon-code/codestyler`
272-
- `ergebnis/composer-normalize`
273-
- Updates the `.github/dependabot.yml` file
274-
- Updates the `.editorconfig` file
275-
- Will correct the order of elements in the `composer.json` file to match
276-
the [official schema](https://github.com/composer/composer/blob/main/res/composer-schema.json).
277-
- Corrects the code style of your project.
278-
279-
```yml
280-
name: Code Style
281-
282-
on: [ push, pull_request ]
283-
284-
permissions: write-all
285-
286-
jobs:
287-
style:
288-
name: Code Style
289-
uses: TheDragonCode/.github/.github/workflows/code-style.yml@main
290-
```
291-
292-
### Other CI/CD
165+
### CI/CD
293166

294167
```bash
295168
composer global require dragon-code/codestyler

app/Enums/PhpVersion.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ enum PhpVersion: string
1010
{
1111
use Values;
1212

13-
case v81 = '8.1';
14-
case v81risky = '8.1-risky';
1513
case v82 = '8.2';
1614
case v82risky = '8.2-risky';
1715
case v83 = '8.3';
1816
case v83risky = '8.3-risky';
17+
case v84 = '8.4';
18+
case v84risky = '8.4-risky';
1919
}

app/Helpers/PhpVersion.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
class PhpVersion
1515
{
16-
public const DEFAULT = '8.3';
17-
public const MIN = '8.1';
16+
public const DEFAULT = '8.4';
17+
public const MIN = '8.2';
1818

1919
public static function get(): string
2020
{

app/Output/SummaryOutput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
class SummaryOutput extends BaseOutput
1111
{
1212
protected $presets = [
13-
'8.1' => 'PHP 8.1',
14-
'8.1-risky' => 'PHP 8.1 with risky',
1513
'8.2' => 'PHP 8.2',
1614
'8.2-risky' => 'PHP 8.2 with risky',
1715
'8.3' => 'PHP 8.3',
1816
'8.3-risky' => 'PHP 8.3 with risky',
17+
'8.4' => 'PHP 8.4',
18+
'8.4-risky' => 'PHP 8.4 with risky',
1919
];
2020
}

composer.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
}
4646
],
4747
"require": {
48-
"php": "^8.1",
48+
"php": "^8.2",
4949
"ext-dom": "*",
5050
"ext-json": "*",
5151
"ext-libxml": "*",
@@ -54,19 +54,19 @@
5454
"ext-xml": "*"
5555
},
5656
"require-dev": {
57-
"archtechx/enums": "^1.0",
57+
"archtechx/enums": "^1.1",
5858
"dragon-code/pretty-array": "^4.1",
59-
"dragon-code/support": "^6.12.0",
60-
"friendsofphp/php-cs-fixer": "^3.49.0",
61-
"illuminate/view": "^10.44.0",
62-
"kubawerlos/php-cs-fixer-custom-fixers": "^3.20.0",
63-
"laravel-zero/framework": "^10.3.0",
64-
"mockery/mockery": "^1.6.7",
65-
"nunomaduro/termwind": "^1.15.1",
66-
"pedrotroller/php-cs-custom-fixer": "^2.33.0",
67-
"pestphp/pest": "^2.33.6",
68-
"seld/jsonlint": "^1.10.2",
69-
"symfony/yaml": "^6.4.3 || ^7.0"
59+
"dragon-code/support": "^6.15.0",
60+
"friendsofphp/php-cs-fixer": "^3.65.0",
61+
"illuminate/view": "^11.33.2",
62+
"kubawerlos/php-cs-fixer-custom-fixers": "^3.22.0",
63+
"laravel-zero/framework": "^11.0.3",
64+
"mockery/mockery": "^1.6.12",
65+
"nunomaduro/termwind": "^2.3",
66+
"pedrotroller/php-cs-custom-fixer": "^2.33.2",
67+
"pestphp/pest": "^3.5.1",
68+
"seld/jsonlint": "^1.11.0",
69+
"symfony/yaml": "^6.4.3 || ^7.1.6"
7070
},
7171
"minimum-stability": "stable",
7272
"prefer-stable": true,
@@ -93,7 +93,7 @@
9393
},
9494
"optimize-autoloader": true,
9595
"platform": {
96-
"php": "8.1.20"
96+
"php": "8.2.26"
9797
},
9898
"preferred-install": "dist",
9999
"sort-packages": true

0 commit comments

Comments
 (0)