Skip to content

Commit a2bae7f

Browse files
authored
Merge pull request #67 from koriym/php84
Add PHP 8.4 Support
2 parents 12d4988 + 5501afd commit a2bae7f

25 files changed

+137
-298
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,26 @@ jobs:
1515
operating-system:
1616
- ubuntu-latest
1717
php-version:
18-
- '5.4'
19-
- '5.5'
20-
- '5.6'
21-
- '7.0'
22-
- '7.1'
23-
- '7.2'
24-
- '7.3'
25-
- '7.4'
26-
- '8.0'
27-
- '8.1'
28-
- '8.2'
18+
- '8.4'
19+
- '8.5'
2920
steps:
3021
- name: Checkout
31-
uses: actions/checkout@v1
22+
uses: actions/checkout@v4
3223

3324
- name: Setup PHP ${{ matrix.php-version }}
3425
uses: shivammathur/setup-php@v2
3526
with:
3627
php-version: ${{ matrix.php-version }}
3728
coverage: xdebug
38-
tools: composer:2.2
29+
tools: composer:v2
3930
ini-values: assert.exception=1, zend.assertions=1
4031

4132
- name: Get composer cache directory
4233
id: composer-cache
4334
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
4435

4536
- name: Cache dependencies
46-
uses: actions/cache@v2
37+
uses: actions/cache@v4
4738
with:
4839
path: ${{ steps.composer-cache.outputs.dir }}
4940
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -56,6 +47,36 @@ jobs:
5647
run: php -d xdebug.mode=coverage ./vendor/bin/phpunit --coverage-clover=coverage.xml
5748

5849
- name: Upload coverage report
59-
uses: codecov/codecov-action@v2
50+
uses: codecov/codecov-action@v5
6051
with:
6152
fail_ci_if_error: false
53+
54+
static-analysis:
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
61+
- name: Setup PHP 8.4
62+
uses: shivammathur/setup-php@v2
63+
with:
64+
php-version: '8.4'
65+
tools: composer:v2
66+
67+
- name: Get composer cache directory
68+
id: composer-cache
69+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
70+
71+
- name: Cache dependencies
72+
uses: actions/cache@v4
73+
with:
74+
path: ${{ steps.composer-cache.outputs.dir }}
75+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
76+
restore-keys: ${{ runner.os }}-composer-
77+
78+
- name: Install dependencies
79+
run: composer install --no-interaction --prefer-dist
80+
81+
- name: Run PHPStan
82+
run: composer phpstan

.scrutinizer.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
build:
2+
image: default-jammy
3+
environment:
4+
php: 8.4
25
nodes:
36
analysis:
47
tests:
58
override:
69
- php-scrutinizer-run
10+
711
filter:
812
paths: ["src/*"]

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## 6.0.0
4+
5+
- PHP 8.4+ required
6+
- Removed Aura.Di integration (config/Common.php)
7+
38
## 2.6.0
49
- ADD: Nested HTML snippet/structure helper via #41 by @jakejohns
510
- ADD: Overriding helper factories via #55 by @jakejohns

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2011-2022, The Aura Project for PHP
1+
Copyright (c) 2011-2025, The Aura Project for PHP
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,27 @@ Provides HTML escapers and helpers, including form input helpers, that can be us
66

77
### Installation
88

9-
This library requires PHP 5.3 or later with `mbstring` and/or `iconv` installed; we recommend using the latest available version of PHP as a matter of principle. It has no userland dependencies.
9+
This library requires PHP 8.4 or later with at least one of the `mbstring` or `iconv` extensions. It has no userland dependencies.
1010

1111
It is installable and autoloadable via Composer as [aura/html](https://packagist.org/packages/aura/html).
1212

13-
Alternatively, [download a release](https://github.com/auraphp/Aura.Html/releases) or clone this repository, then require or include its _autoload.php_ file.
14-
1513
### Quality
1614

17-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/auraphp/Aura.Html/badges/quality-score.png?b=2.x)](https://scrutinizer-ci.com/g/auraphp/Aura.Html/)
18-
[![codecov](https://codecov.io/gh/auraphp/Aura.Html/branch/2.x/graph/badge.svg?token=UASDouLxyc)](https://codecov.io/gh/auraphp/Aura.Html)
19-
[![Continuous Integration](https://github.com/auraphp/Aura.Html/actions/workflows/continuous-integration.yml/badge.svg?branch=2.x)](https://github.com/auraphp/Aura.Html/actions/workflows/continuous-integration.yml)
15+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/auraphp/Aura.Html/badges/quality-score.png?b=6.x)](https://scrutinizer-ci.com/g/auraphp/Aura.Html/)
16+
[![codecov](https://codecov.io/gh/auraphp/Aura.Html/branch/6.x/graph/badge.svg?token=UASDouLxyc)](https://codecov.io/gh/auraphp/Aura.Html)
17+
[![Continuous Integration](https://github.com/auraphp/Aura.Html/actions/workflows/continuous-integration.yml/badge.svg?branch=6.x)](https://github.com/auraphp/Aura.Html/actions/workflows/continuous-integration.yml)
2018

2119
To run the unit tests at the command line, issue `composer install` and then `vendor/bin/phpunit` at the package root. This requires [Composer](http://getcomposer.org/) to be available as `composer`.
2220

23-
This library attempts to comply with [PSR-1][], [PSR-2][], and [PSR-4][]. If
24-
you notice compliance oversights, please send a patch via pull request.
21+
This library attempts to comply with [PSR-1][], [PSR-12][], and [PSR-4][].
2522

26-
[PSR-1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md
27-
[PSR-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
28-
[PSR-4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md
23+
[PSR-1]: https://www.php-fig.org/psr/psr-1/
24+
[PSR-12]: https://www.php-fig.org/psr/psr-12/
25+
[PSR-4]: https://www.php-fig.org/psr/psr-4/
2926

3027
### Community
3128

32-
To ask questions, provide feedback, or otherwise communicate with the Aura community, please join our [Google Group](http://groups.google.com/group/auraphp), follow [@auraphp on Twitter](http://twitter.com/auraphp), or chat with us on #auraphp on Freenode.
33-
29+
To ask questions, provide feedback, or otherwise communicate with the Aura community, please join our [Google Group](http://groups.google.com/group/auraphp), follow [@auraphp on X](https://x.com/auraphp), or chat with us on #auraphp on Freenode.
3430

3531
## Getting Started
3632

autoload.php

Lines changed: 0 additions & 45 deletions
This file was deleted.

composer.json

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,26 @@
2222
}
2323
],
2424
"require": {
25-
"php": ">=5.3.0"
25+
"php": "^8.4"
26+
},
27+
"require-dev": {
28+
"phpstan/phpstan": "^2.0",
29+
"phpunit/phpunit": "^11.0",
30+
"yoast/phpunit-polyfills": "^3.0"
2631
},
2732
"autoload": {
2833
"psr-4": {
29-
"Aura\\Html\\": "src/",
30-
"Aura\\Html\\_Config\\": "config/"
31-
}
32-
},
33-
"extra": {
34-
"aura": {
35-
"type": "library",
36-
"config": {
37-
"common": "Aura\\Html\\_Config\\Common"
38-
}
34+
"Aura\\Html\\": "src/"
3935
}
4036
},
41-
"require-dev": {
42-
"yoast/phpunit-polyfills": "~1.0"
43-
},
4437
"autoload-dev": {
4538
"psr-4": {
46-
"Aura\\Html\\": "tests/",
47-
"Aura\\Di\\": "vendor/aura/di/tests/"
39+
"Aura\\Html\\": "tests/"
4840
}
41+
},
42+
"scripts": {
43+
"test": "phpunit",
44+
"test-coverage": "php -d xdebug.mode=coverage phpunit --coverage-clover=coverage.xml",
45+
"phpstan": "phpstan analyse --level=2 src/"
4946
}
50-
}
47+
}

config/Common.php

Lines changed: 0 additions & 100 deletions
This file was deleted.

phpunit.xml.dist

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<?xml version="1.0"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./phpunit.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage processUncoveredFiles="true">
4-
<include>
5-
<directory suffix=".php">./src</directory>
6-
</include>
7-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
4+
bootstrap="./phpunit.php"
5+
colors="true">
86
<testsuites>
97
<testsuite name="Aura.Html test suite">
108
<directory>./tests</directory>
9+
<exclude>./tests/Escaper/AbstractEscaperTest.php</exclude>
10+
<exclude>./tests/Helper/AbstractHelperTest.php</exclude>
1111
</testsuite>
1212
</testsuites>
13-
</phpunit>
13+
<source>
14+
<include>
15+
<directory suffix=".php">./src</directory>
16+
</include>
17+
</source>
18+
</phpunit>

src/Escaper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function __invoke()
124124
*
125125
* @param string $encoding The encoding to use.
126126
*
127-
* @return null
127+
* @return void
128128
*
129129
*/
130130
public function setEncoding($encoding)
@@ -141,7 +141,7 @@ public function setEncoding($encoding)
141141
*
142142
* @param int $flags The `htmlspecialchars()` flags.
143143
*
144-
* @return null
144+
* @return void
145145
*
146146
*/
147147
public function setFlags($flags)
@@ -212,7 +212,7 @@ public function js($raw)
212212
*
213213
* @param Escaper $escaper The Escaper to use as the singleton.
214214
*
215-
* @return null
215+
* @return void
216216
*
217217
*/
218218
public static function setStatic(Escaper $escaper)

0 commit comments

Comments
 (0)