Skip to content

Commit b4cf174

Browse files
Added support for PHP 8.4
1 parent a0ae5c8 commit b4cf174

42 files changed

Lines changed: 300 additions & 274 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,26 @@ root = true
55

66
[*]
77
charset = utf-8
8+
end_of_line = lf
89
indent_size = 4
910
indent_style = space
10-
end_of_line = lf
1111
insert_final_newline = true
1212
trim_trailing_whitespace = true
1313

1414
[*.js]
1515
indent_size = 2
1616

17-
[*.json]
18-
indent_size = 2
19-
20-
[*.json.dist]
21-
indent_size = 2
22-
23-
[*.json5]
24-
indent_size = 2
25-
26-
[*.json5.dist]
17+
[*.{json,json.dist}]
2718
indent_size = 2
2819

2920
[*.md]
3021
trim_trailing_whitespace = false
3122

32-
[*.neon]
33-
indent_size = 2
34-
35-
[*.neon.dist]
36-
indent_size = 2
37-
38-
[*.xml]
39-
indent_size = 2
40-
41-
[*.xml.dist]
23+
[*.{neon,neon.dist}]
4224
indent_size = 2
4325

44-
[*.yml]
26+
[*.{xml,xml.dist}]
4527
indent_size = 2
4628

47-
[*.yml.dist]
29+
[*.{yml,yml.dist}]
4830
indent_size = 2

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Path-based git attributes
22
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
33

4-
# Ignore all test and documentation with "export-ignore".
4+
# Ignore tests and tooling with "export-ignore"
55
/.github/ export-ignore
66
/tests/ export-ignore
77
/.editorconfig export-ignore

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Before submitting a pull request:
4949

5050
## Requirements
5151

52-
- *[PSR-12 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md)* where possible - falling back to [PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) otherwise - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer).
52+
- *[PSR-12 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md)* where possible - falling back to [PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) otherwise - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer).
5353

5454
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
5555

.github/workflows/run-tests.yml

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: run-tests
1+
name: "run-tests"
22

33
on:
44
push:
@@ -8,31 +8,33 @@ on:
88
schedule:
99
- cron: "0 0 * * 0"
1010

11-
permissions:
12-
contents: read
13-
1411
jobs:
1512

1613
all_tests:
1714

1815
name: "PHP${{ matrix.php }} TB${{ matrix.testbench }} ${{ matrix.os-title }} ${{ matrix.dependency-prefer-title }}"
1916
runs-on: "${{ matrix.os }}"
17+
permissions:
18+
contents: "read"
2019
strategy:
2120
fail-fast: true
2221
matrix:
2322
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
24-
php: [ "8.3", "8.2", "8.1", "8.0" ]
25-
testbench: [ "^8.0", "^7.0", "^6.26", "^6.0" ]
23+
php: [ "8.4", "8.3", "8.2", "8.1", "8.0" ]
24+
testbench: [ "^9.0", "^8.0", "^7.0", "^6.26", "^6.0" ]
2625
dependency-prefer: [ "prefer-stable", "prefer-lowest" ]
2726
include:
27+
- php: "8.4"
28+
phpunit: "^10.5.44 | ^11.0"
29+
phpunit-config-file: "phpunit.github-actions.xml.dist"
2830
- php: "8.3"
29-
phpunit: "^10.1.0"
31+
phpunit: "^10.5.44 | ^11.0"
3032
phpunit-config-file: "phpunit.github-actions.xml.dist"
3133
- php: "8.2"
32-
phpunit: "^10.1.0"
34+
phpunit: "^10.5.44 | ^11.0"
3335
phpunit-config-file: "phpunit.github-actions.xml.dist"
3436
- php: "8.1"
35-
phpunit: "^10.1.0"
37+
phpunit: "^10.5.44"
3638
phpunit-config-file: "phpunit.github-actions.xml.dist"
3739
- php: "8.0"
3840
phpunit: "^9.3"
@@ -62,11 +64,25 @@ jobs:
6264
dependency-prefer-title: "stable"
6365
- dependency-prefer: "prefer-lowest"
6466
dependency-prefer-title: "lowest"
67+
6568
exclude:
69+
- testbench: "^9.0"
70+
php: "8.1"
71+
- testbench: "^9.0"
72+
php: "8.0"
73+
74+
# - testbench: "^8.0"
75+
# php: "8.4"
76+
# - testbench: "^8.0"
77+
# php: "8.3"
6678
- testbench: "^8.0"
6779
php: "8.0"
80+
6881
- testbench: "^6.26" # Laravel 8 for higher versions of PHP
6982
php: "8.0"
83+
84+
- testbench: "^6.0" # Laravel 8 for lower versions of PHP
85+
php: "8.4"
7086
- testbench: "^6.0" # Laravel 8 for lower versions of PHP
7187
php: "8.3"
7288
- testbench: "^6.0" # Laravel 8 for lower versions of PHP
@@ -78,45 +94,46 @@ jobs:
7894
- name: "Checkout code"
7995
uses: "actions/checkout@v4"
8096

81-
- name: "Validate composer.json and composer.lock"
82-
run: "composer validate --strict"
83-
8497
- name: "Setup PHP"
8598
uses: "shivammathur/setup-php@v2"
8699
with:
87100
php-version: "${{ matrix.php }}"
88-
extensions: fileinfo # required by league/flysystem on Windows
101+
extensions: "fileinfo" # required by league/flysystem on Windows
89102
ini-values: "error_reporting=E_ALL"
90-
coverage: none
103+
coverage: "none"
91104
env:
92105
COMPOSER_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
93106

107+
- name: "Validate composer.json and composer.lock"
108+
run: "composer validate --strict"
109+
94110
# find composer's cache directory - so we know which directory to cache in the next step
95111
- name: "Find composer's cache directory"
96112
id: "composer-cache"
97-
shell: bash # make sure this step works on Windows - see https://github.com/actions/runner/issues/2224#issuecomment-1289533957
113+
shell: "bash" # make sure this step works on Windows - see https://github.com/actions/runner/issues/2224#issuecomment-1289533957
98114
run: |
99115
echo "composer_cache_dir=$(composer config cache-files-dir)">> "$GITHUB_OUTPUT"
100116
101117
- name: "Cache composer's cache directory"
102-
uses: "actions/cache@v3"
118+
uses: "actions/cache@v4"
103119
with:
104120
path: "${{ steps.composer-cache.outputs.composer_cache_dir }}"
105121
key: "[${{ matrix.os }}][php-${{ matrix.php }}][testbench-${{ matrix.testbench }}][${{ matrix.dependency-prefer }}][composer.json-${{ hashFiles('composer.json') }}]"
106122

107123
- name: "Install dependencies"
108-
uses: "nick-fields/retry@v2"
124+
uses: "nick-fields/retry@v3"
109125
with:
110126
timeout_minutes: 5
111127
max_attempts: 5
112-
shell: bash # make sure "^" characters are interpreted properly on Windows (e.g. in "^5.0")
128+
shell: "bash" # make sure "^" characters are interpreted properly on Windows (e.g. in "^5.0")
113129
command: |
114130
composer remove "infection/infection" --dev --no-interaction --no-update
115-
composer remove "phpstan/phpstan" --dev --no-interaction --no-update
116-
composer remove "squizlabs/php_codesniffer" --dev --no-interaction --no-update
117131
composer require "orchestra/testbench:${{ matrix.testbench }}" --dev --no-interaction --no-update
132+
composer remove "phpstan/phpstan" --dev --no-interaction --no-update
133+
composer remove "phpstan/phpstan-strict-rules" --dev --no-interaction --no-update
118134
composer require "phpunit/phpunit:${{ matrix.phpunit }}" --dev --no-interaction --no-update
135+
composer remove "squizlabs/php_codesniffer" --dev --no-interaction --no-update
119136
composer update --${{ matrix.dependency-prefer }} --prefer-dist --no-interaction --optimize-autoloader --no-progress
120137
121138
- name: "Execute tests"
122-
run: vendor/bin/phpunit --configuration=${{ matrix.phpunit-config-file }} --no-coverage --stop-on-error --stop-on-failure
139+
run: vendor/bin/phpunit "--configuration=${{ matrix.phpunit-config-file }}" --no-coverage --stop-on-error --stop-on-failure

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.idea/
22
.phpunit/
33
.phpunit.cache/
4+
.vscode/
45
build/
56
infection/
67
phpunit/

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22

33
All notable changes to `code-distortion/clarity-context` will be documented in this file.
44

5-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77

88

9-
## [0.1.0] - 2023-12-31
9+
## [0.1.1] - 2024-02-05
10+
11+
### Added
12+
- Added support for PHP 8.4
13+
14+
15+
16+
## [0.1.0] - 2023-12-31
1017

1118
### Added
1219
- Initial release

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Tim Chandler
3+
Copyright (c) 2025 Tim Chandler
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Clarity Context - Understand Your Exceptions
22

33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/code-distortion/clarity-context.svg?style=flat-square)](https://packagist.org/packages/code-distortion/clarity-context)
4-
![PHP Version](https://img.shields.io/badge/PHP-8.0%20to%208.3-blue?style=flat-square)
5-
![Laravel](https://img.shields.io/badge/laravel-8%20to%2010-blue?style=flat-square)
6-
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/code-distortion/clarity-context/run-tests.yml?branch=master&style=flat-square)](https://github.com/code-distortion/clarity-context/actions)
4+
![PHP Version](https://img.shields.io/badge/PHP-8.0%20to%208.4-blue?style=flat-square)
5+
![Laravel](https://img.shields.io/badge/laravel-8%20to%2011-blue?style=flat-square)
6+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/code-distortion/clarity-context/run-tests.yml?branch=main&style=flat-square)](https://github.com/code-distortion/clarity-context/actions)
77
[![Buy The World a Tree](https://img.shields.io/badge/treeware-%F0%9F%8C%B3-lightgreen?style=flat-square)](https://plant.treeware.earth/code-distortion/clarity-context)
88
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v2.1%20adopted-ff69b4.svg?style=flat-square)](.github/CODE_OF_CONDUCT.md)
99

@@ -302,7 +302,7 @@ You can retrieve the following details from the Meta objects:
302302

303303
``` php
304304
// all Meta classes
305-
$meta->getFile(); // the relevant file
305+
$meta->getFile(); // the relevant file
306306
$meta->getProjectFile(); // the same file, but relative to the project-root's dir
307307
$meta->getLine(); // the relevant line number
308308
$meta->getFunction(); // the function or method being run at the time
@@ -346,7 +346,7 @@ $context->getCallStack()->getMetaGroups();
346346
Each MetaGroup contains similar details to the `Frame` object.
347347

348348
``` php
349-
$metaGroup->getFile(); // the path to the file containing the code being run
349+
$metaGroup->getFile(); // the path to the file containing the code being run
350350
$metaGroup->getProjectFile(); // the same file, but relative to the project-root's dir
351351
$metaGroup->getLine(); // the relevant line number
352352
$metaGroup->getFunction(); // the function or method being run at the time

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
}
2222
],
2323
"require": {
24-
"php": "8.0.* | 8.1.* | 8.2.* | 8.3.*",
25-
"code-distortion/staticall": "^0.1.0"
24+
"php": "8.0.* | 8.1.* | 8.2.* | 8.3.* | 8.4.*"
2625
},
2726
"require-dev": {
28-
"infection/infection": "^0.10 | ^0.11 | ^0.12 | ^0.13 | ^0.14 | ^0.15 | ^0.16 | ^0.17 | ^0.18 | ^0.19 | ^0.20 | ^0.21 | ^0.22 | ^0.23 | ^0.24 | ^0.25 | ^0.26 | ^0.27",
29-
"orchestra/testbench": "^6.12 | ^7.0 | ^8.0",
30-
"phpstan/phpstan": "^0.9 | ^0.10 | ^0.11 | ^0.12 | ^1.0",
31-
"phpunit/phpunit": "~4.8 | ^5.0 | ^6.0 | ^7.0 | ^8.4 | ^9.0 | ^10.0",
32-
"squizlabs/php_codesniffer": "^3.8.0"
27+
"infection/infection": "^0.26 | ^0.27 | ^0.28 | ^0.29",
28+
"orchestra/testbench": "^6.12 | ^7.0 | ^8.0 | ^9.0",
29+
"phpstan/phpstan": "^2.0",
30+
"phpstan/phpstan-strict-rules": "^2.0",
31+
"phpunit/phpunit": "^9.6.22 | ^10.0 | ^11.0",
32+
"squizlabs/php_codesniffer": "^3.11.2"
3333
},
3434
"autoload": {
3535
"psr-4": {

infection.json.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"source": {
44
"directories": [
55
"src"
6-
],
6+
]
77
"excludes": [
88
"src/ServiceProvider.php"
99
]
@@ -14,7 +14,7 @@
1414
"html": "infection/infection.html",
1515
"summary": "infection/summary.log",
1616
"json": "infection/infection-log.json",
17-
"perMutator": "infection/per-mutator.md",
17+
"perMutator": "infection/per-mutator.md"
1818
},
1919
"mutators": {
2020
"@default": true

0 commit comments

Comments
 (0)