Skip to content

Commit 6fc6a89

Browse files
committed
PHP 8.5 compatibility fixes
Now also runs test suite on PHP 8.5 by default
1 parent 1a6da94 commit 6fc6a89

File tree

5 files changed

+33
-9
lines changed

5 files changed

+33
-9
lines changed

CHANGELOG.textile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ h1. Changelog
22

33
Here's a summary of changes in each release. The list doesn't include some small changes or updates to test cases.
44

5-
h2. Version 4.1.4 - upcoming
5+
h2. "Version 4.1.4 - 2025/12/20":https://github.com/textile/php-textile/releases/tag/v4.1.4
6+
7+
* Fix PHP 8.5 compatibility issues with note list rendering.
68

79
h2. "Version 4.1.3 - 2025/01/07":https://github.com/textile/php-textile/releases/tag/v4.1.3
810

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
php:
3-
build: ./docker/image/${IMAGE:-php_8_4}
3+
build: ./docker/image/${IMAGE:-php_8_5}
44
volumes:
55
- .:/app
66
- ${COMPOSER_HOME:-$HOME/.composer}:/composer

docker/image/php_8_5/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM php:8.5-cli
2+
3+
RUN apt-get update && apt-get install -y \
4+
bash \
5+
git \
6+
libz-dev \
7+
zip \
8+
wget
9+
10+
RUN pecl install xdebug-3.5.0
11+
12+
RUN docker-php-ext-enable xdebug
13+
14+
COPY --from=composer:2.9 /usr/bin/composer /usr/bin/composer
15+
16+
WORKDIR /app

phpstan.neon

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
parameters:
2-
ignoreErrors:
3-
- '#Parameter \#2 \$callback of function preg_replace_callback#'
4-
- "#Cannot access offset '[a-zA-Z0-9\\_]+' on non-empty-array#"
5-
- '#Cannot access offset [0-9]+ on array#'
6-
- "#Offset '[a-zA-Z0-9\\_]+' does not exist on array#"
2+
reportUnmatchedIgnoredErrors: false
3+
ignoreErrors:
4+
- '#Parameter \#2 \$callback of function preg_replace_callback#'
5+
- "#Cannot access offset '[a-zA-Z0-9\\_]+' on non-empty-array#"
6+
- '#Cannot access offset [0-9]+ on array#'
7+
- "#Offset '[a-zA-Z0-9\\_]+' does not exist on array#"

src/Netcarver/Textile/Parser.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ class Parser
384384
*
385385
* @var string
386386
*/
387-
protected $ver = '4.1.4-dev';
387+
protected $ver = '4.1.4';
388388

389389
/**
390390
* Regular expression snippets.
@@ -3865,7 +3865,12 @@ protected function makeBackrefLink($info, $g_links, $i)
38653865
foreach ($items as $id) {
38663866
$out[] = '<sup><a href="#noteref'.$id.'">'. (($decode) ? $this->decodeHigh($i_) : $i_) .'</a></sup>';
38673867
if ($allow_inc) {
3868-
$i_++;
3868+
if (function_exists('str_increment')) {
3869+
// @phpstan-ignore-next-line
3870+
$i_ = str_increment($i_);
3871+
} else {
3872+
$i_++;
3873+
}
38693874
}
38703875
}
38713876

0 commit comments

Comments
 (0)