Skip to content

Commit 44f2c0d

Browse files
authored
Add PHP 8.4 (#240)
1 parent cc467a7 commit 44f2c0d

9 files changed

Lines changed: 25 additions & 15 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
os: >-
3232
['ubuntu-latest', 'windows-latest']
3333
php: >-
34-
['8.1', '8.2', '8.3']
34+
['8.1', '8.2', '8.3', '8.4']

.github/workflows/composer-require-checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
os: >-
3232
['ubuntu-latest']
3333
php: >-
34-
['8.1', '8.2', '8.3']
34+
['8.1', '8.2', '8.3', '8.4']

.github/workflows/mutation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
os: >-
2828
['ubuntu-latest']
2929
php: >-
30-
['8.3']
30+
['8.4']
3131
bin-name: infection
3232
secrets:
3333
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.github/workflows/rector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
os: >-
2222
['ubuntu-latest']
2323
php: >-
24-
['8.3']
24+
['8.4']

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
os: >-
3030
['ubuntu-latest']
3131
php: >-
32-
['8.1', '8.2', '8.3']
32+
['8.1', '8.2', '8.3', '8.4']

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Bug #232: Render `loading` attribute before `src` (@samdark)
66
- Enh #223: Make `$content` parameter optional in `Button` factories (@FrankiFixx)
7+
- Chg #240: Change PHP constraint in `composer.json` to `~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0` (@vjik)
78

89
## 3.9.0 November 29, 2024
910

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
}
2727
],
2828
"require": {
29-
"php": "^8.1",
29+
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
3030
"yiisoft/arrays": "^2.0|^3.0",
3131
"yiisoft/json": "^1.0"
3232
},
3333
"require-dev": {
34-
"infection/infection": "^0.27",
35-
"maglnet/composer-require-checker": "^4.7",
36-
"phpunit/phpunit": "^10.5",
37-
"rector/rector": "^2.0",
34+
"infection/infection": "^0.27.11 || ^0.29.10",
35+
"maglnet/composer-require-checker": "^4.7.1",
36+
"phpunit/phpunit": "^10.5.45",
37+
"rector/rector": "^2.0.8",
3838
"spatie/phpunit-watcher": "^1.24",
39-
"vimeo/psalm": "^5.26"
39+
"vimeo/psalm": "^5.26.1|^6.4.1"
4040
},
4141
"autoload": {
4242
"psr-4": {
@@ -50,6 +50,7 @@
5050
},
5151
"config": {
5252
"sort-packages": true,
53+
"bump-after-update": "dev",
5354
"allow-plugins": {
5455
"infection/extension-installer": true,
5556
"composer/package-versions-deprecated": true

src/Html.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ public static function renderTagAttributes(array $attributes): string
16921692
*
16931693
* @see removeCssClass()
16941694
*
1695-
* @param array $options The options to be modified.
1695+
* @param array $options The options to be modified. All string values in the array must be valid UTF-8 strings.
16961696
* @param BackedEnum|BackedEnum[]|null[]|string|string[]|null $class The CSS class(es) to be added. Null values will
16971697
* be ignored.
16981698
*
@@ -1733,7 +1733,11 @@ public static function addCssClass(array &$options, BackedEnum|array|string|null
17331733
/** @psalm-var string[] $options['class'] */
17341734
$options['class'] = self::mergeCssClasses($options['class'], (array) $class);
17351735
} else {
1736-
/** @psalm-var string $options['class'] */
1736+
/**
1737+
* @psalm-var string $options['class']
1738+
* @var string[] $classes We assume that `$options['class']` is valid UTF-8 string, so `preg_split()`
1739+
* never returns `false`.
1740+
*/
17371741
$classes = preg_split('/\s+/', $options['class'], -1, PREG_SPLIT_NO_EMPTY);
17381742
$classes = self::mergeCssClasses($classes, (array) $class);
17391743
$options['class'] = is_array($class) ? $classes : implode(' ', $classes);
@@ -1937,7 +1941,7 @@ public static function cssStyleToArray(string|Stringable $style): array
19371941
*
19381942
* @link https://html.spec.whatwg.org/multipage/input.html#the-pattern-attribute
19391943
*
1940-
* @param string $regexp PCRE regular expression.
1944+
* @param string $regexp PCRE regular expression. It must be valid UTF-8 string.
19411945
* @param string|null $delimiter Regular expression delimiter.
19421946
*
19431947
* @throws InvalidArgumentException if incorrect regular expression or delimiter
@@ -1950,6 +1954,10 @@ public static function normalizeRegexpPattern(string $regexp, ?string $delimiter
19501954
throw new InvalidArgumentException('Incorrect regular expression.');
19511955
}
19521956

1957+
/**
1958+
* @var string $pattern We assume that `$regexp` is valid UTF-8 string, so `preg_replace()` never returns
1959+
* `null`.
1960+
*/
19531961
$pattern = preg_replace('/\\\\x{?([0-9a-fA-F]+)}?/', '\u$1', $regexp);
19541962

19551963
if ($delimiter === null) {

tests/Tag/LinkTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public static function dataPreload(): array
125125
}
126126

127127
#[DataProvider('dataPreload')]
128-
public function testPreload(string $expected, string $url, string $as = null): void
128+
public function testPreload(string $expected, string $url, ?string $as = null): void
129129
{
130130
$tag = $as === null
131131
? Link::tag()->preload($url)

0 commit comments

Comments
 (0)