update to 12.5.1

raise dependency on nikic/php-parser 5.7.0
raise dependency on theseer/tokenizer 2.0.1
add upstream patch for theseer/tokenizer 2.x

(cherry picked from commit 1203b8e014)
This commit is contained in:
Remi Collet 2025-12-10 08:59:34 +01:00
commit ec170c6411
4 changed files with 58 additions and 13 deletions

1
.gitignore vendored
View file

@ -16,3 +16,4 @@
/php-phpunit-php-code-coverage12-12.3.8-99e692c.tgz
/php-phpunit-php-code-coverage12-12.4.0-67e8aed.tgz
/php-phpunit-php-code-coverage12-12.5.0-bca180c.tgz
/php-phpunit-php-code-coverage12-12.5.1-c467c59.tgz

View file

@ -10,11 +10,11 @@
%bcond_without tests
# Github
%global gh_commit bca180c050dd3ae15f87c26d25cabb34fe1a0a5a
%global gh_commit c467c59a4f6e04b942be422844e7a6352fa01b57
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner sebastianbergmann
%global gh_project php-code-coverage
%global gh_date 2025-11-29
%global gh_date 2025-12-08
# Packagist
%global pk_vendor phpunit
%global pk_project php-code-coverage
@ -25,7 +25,7 @@
%global ver_major 12
Name: php-%{pk_vendor}-%{pk_project}%{ver_major}
Version: 12.5.0
Version: 12.5.1
Release: 1%{?dist}
Summary: PHP code coverage information, version %{ver_major}
@ -39,26 +39,27 @@ URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: %{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
Patch0: upstream.patch
BuildArch: noarch
BuildRequires: php(language) >= 8.3
BuildRequires: php-fedora-autoloader-devel >= 1.0.0
%if %{with tests}
BuildRequires: (php-composer(nikic/php-parser) >= 5.6.2 with php-composer(nikic/php-parser) < 6)
BuildRequires: (php-composer(nikic/php-parser) >= 5.7.0 with php-composer(nikic/php-parser) < 6)
BuildRequires: (php-composer(phpunit/php-file-iterator) >= 6.0 with php-composer(phpunit/php-file-iterator) < 7)
BuildRequires: (php-composer(phpunit/php-text-template) >= 5.0 with php-composer(phpunit/php-text-template) < 6)
BuildRequires: (php-composer(sebastian/complexity) >= 5.0 with php-composer(sebastian/complexity) < 6)
BuildRequires: (php-composer(sebastian/environment) >= 8.0.3 with php-composer(sebastian/environment) < 9)
BuildRequires: (php-composer(sebastian/lines-of-code) >= 4.0 with php-composer(sebastian/lines-of-code) < 5)
BuildRequires: (php-composer(sebastian/version) >= 6.0 with php-composer(sebastian/version) < 7)
BuildRequires: (php-composer(theseer/tokenizer) >= 1.3.1 with php-composer(theseer/tokenizer) < 2)
BuildRequires: (php-composer(theseer/tokenizer) >= 2.0.1 with php-composer(theseer/tokenizer) < 3)
BuildRequires: php-dom
BuildRequires: php-json
BuildRequires: php-libxml
BuildRequires: php-tokenizer
BuildRequires: php-xmlwriter
# From composer.json, "require-dev": {
# "phpunit/phpunit": "^12.4.4"
BuildRequires: phpunit12 >= 12.4.4
# "phpunit/phpunit": "^12.5.1"
BuildRequires: phpunit12 >= 12.5
BuildRequires: php-xdebug
%endif
@ -67,26 +68,26 @@ BuildRequires: php-xdebug
# "ext-dom": "*",
# "ext-libxml": "*",
# "ext-xmlwriter": "*",
# "nikic/php-parser": "^5.6.2",
# "nikic/php-parser": "^5.7.0",
# "phpunit/php-file-iterator": "^6.0",
# "phpunit/php-text-template": "^5.0",
# "sebastian/complexity": "^5.0",
# "sebastian/environment": "^8.0.3",
# "sebastian/lines-of-code": "^4.0",
# "sebastian/version": "^6.0",
# "theseer/tokenizer": "^1.3.1"
# "theseer/tokenizer": "^2.0.1"
Requires: php(language) >= 8.3
Requires: php-dom
Requires: php-libxml
Requires: php-xmlwriter
Requires: (php-composer(nikic/php-parser) >= 5.6.2 with php-composer(nikic/php-parser) < 6)
Requires: (php-composer(nikic/php-parser) >= 5.7.0 with php-composer(nikic/php-parser) < 6)
Requires: (php-composer(phpunit/php-file-iterator) >= 6.0 with php-composer(phpunit/php-file-iterator) < 7)
Requires: (php-composer(phpunit/php-text-template) >= 5.0 with php-composer(phpunit/php-text-template) < 6)
Requires: (php-composer(sebastian/complexity) >= 5.0 with php-composer(sebastian/complexity) < 6)
Requires: (php-composer(sebastian/environment) >= 8.0.3 with php-composer(sebastian/environment) < 9)
Requires: (php-composer(sebastian/lines-of-code) >= 4.0 with php-composer(sebastian/lines-of-code) < 5)
Requires: (php-composer(sebastian/version) >= 6.0 with php-composer(sebastian/version) < 7)
Requires: (php-composer(theseer/tokenizer) >= 1.3.1 with php-composer(theseer/tokenizer) < 2)
Requires: (php-composer(theseer/tokenizer) >= 2.0.1 with php-composer(theseer/tokenizer) < 3)
# From composer.json, suggest
# "ext-pcov": "*",
# "ext-xdebug": "*"
@ -117,6 +118,7 @@ Autoloader: %{php_home}/%{ns_vendor}/%{ns_project}%{ver_major}/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
%patch -P0 -p1
%build
@ -134,7 +136,7 @@ cat << 'EOF' | tee -a src/autoload.php
'%{php_home}/%{ns_vendor}/Environment8/autoload.php',
'%{php_home}/%{ns_vendor}/LinesOfCode4/autoload.php',
'%{php_home}/%{ns_vendor}/Version6/autoload.php',
'%{php_home}/TheSeer/Tokenizer/autoload.php',
'%{php_home}/TheSeer/Tokenizer2/autoload.php',
]);
EOF
@ -187,6 +189,12 @@ exit $ret
%changelog
* Tue Dec 9 2025 Remi Collet <remi@remirepo.net> - 12.5.1-1
- update to 12.5.1
- raise dependency on nikic/php-parser 5.7.0
- raise dependency on theseer/tokenizer 2.0.1
- add upstream patch for theseer/tokenizer 2.x
* Tue Dec 2 2025 Remi Collet <remi@remirepo.net> - 12.5.0-1
- update to 12.5.0
- raise dependency on nikic/php-parser 5.6.1

View file

@ -1 +1 @@
SHA512 (php-phpunit-php-code-coverage12-12.5.0-bca180c.tgz) = 4b41b9295e440424aa6877ce4b6a8b4b4f987932d429c15bb6d08312f7d7fd4f7a5866c7bee938571241623f4bdd621874c367bf056f96ab22c49d42864c0040
SHA512 (php-phpunit-php-code-coverage12-12.5.1-c467c59.tgz) = 840ac7744dbbf518c6d88d6a2b4d8c8251693598bc4ba4ed74a77813f4f42aca3eb78f9a35a9f484572521c48b2f74222bfa9b43930e685f563c4eb6b647ebdb

36
upstream.patch Normal file
View file

@ -0,0 +1,36 @@
From 3cf9ab1cff5a9b8912bd251f7e4fc5f700aea7b7 Mon Sep 17 00:00:00 2001
From: Markus Staab <markus.staab@redaxo.de>
Date: Mon, 8 Dec 2025 12:32:24 +0100
Subject: [PATCH] Fix regression from update to theseer/tokenizer 2.x
---
composer.json | 2 +-
.../source_with_class_and_anonymous_function.php.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/composer.json b/composer.json
index 607a2d5e1..550171f84 100644
--- a/composer.json
+++ b/composer.json
@@ -40,7 +40,7 @@
"sebastian/environment": "^8.0.3",
"sebastian/lines-of-code": "^4.0",
"sebastian/version": "^6.0",
- "theseer/tokenizer": "^2.0"
+ "theseer/tokenizer": "^2.0.1"
},
"require-dev": {
"phpunit/phpunit": "^12.5.1"
diff --git a/tests/_files/Report/XML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.xml b/tests/_files/Report/XML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.xml
index 9ef89df19..88523d37c 100644
--- a/tests/_files/Report/XML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.xml
+++ b/tests/_files/Report/XML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.xml
@@ -100,7 +100,7 @@
<token name="T_FUNCTION">function</token>
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_BRACKET">(</token>
- <token name="T_AMPERSAND">&amp;</token>
+ <token name="T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG">&amp;</token>
<token name="T_VARIABLE">$val</token>
<token name="T_COMMA">,</token>
<token name="T_WHITESPACE"> </token>