From 19acc12cc0496ff069ef1608308bd31338f43c62 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 05:20:01 +0000 Subject: [PATCH 1/4] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- php-pear-PHP-CodeSniffer.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php-pear-PHP-CodeSniffer.spec b/php-pear-PHP-CodeSniffer.spec index 0410feb..c6aab30 100644 --- a/php-pear-PHP-CodeSniffer.spec +++ b/php-pear-PHP-CodeSniffer.spec @@ -24,7 +24,7 @@ Name: php-pear-PHP-CodeSniffer Version: 3.13.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: PHP coding standards enforcement tool License: BSD-3-Clause @@ -145,6 +145,9 @@ fi %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 3.13.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Wed Jun 18 2025 Remi Collet - 3.13.2-1 - update to 3.13.2 From 52d2d3edc1866453b4f6cc111090950751ca1100 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 8 Sep 2025 10:20:22 +0200 Subject: [PATCH 2/4] v3.13.4 --- .gitignore | 65 +---------------------------------- php-pear-PHP-CodeSniffer.spec | 11 +++--- sources | 2 +- 3 files changed, 9 insertions(+), 69 deletions(-) diff --git a/.gitignore b/.gitignore index 5b71888..56db86d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,65 +1,2 @@ clog -/PHP_CodeSniffer-2.2.0.tgz -/PHP_CodeSniffer-2.3.0.tgz -/PHP_CodeSniffer-2.3.1.tgz -/PHP_CodeSniffer-2.3.2.tgz -/PHP_CodeSniffer-2.3.3.tgz -/PHP_CodeSniffer-2.3.4.tgz -/PHP_CodeSniffer-2.4.0.tgz -/PHP_CodeSniffer-2.5.0.tgz -/PHP_CodeSniffer-2.5.1.tgz -/PHP_CodeSniffer-2.6.0.tgz -/PHP_CodeSniffer-2.6.1.tgz -/PHP_CodeSniffer-2.6.2.tgz -/PHP_CodeSniffer-2.7.0.tgz -/PHP_CodeSniffer-2.7.1.tgz -/PHP_CodeSniffer-2.8.0.tgz -/PHP_CodeSniffer-2.8.1.tgz -/PHP_CodeSniffer-3.0.0.tgz -/PHP_CodeSniffer-3.0.1.tgz -/PHP_CodeSniffer-3.0.2.tgz -/PHP_CodeSniffer-3.1.0.tgz -/PHP_CodeSniffer-3.1.1.tgz -/PHP_CodeSniffer-3.2.0.tgz -/PHP_CodeSniffer-3.2.1.tgz -/PHP_CodeSniffer-3.2.2.tgz -/PHP_CodeSniffer-3.2.3.tgz -/PHP_CodeSniffer-3.3.0.tgz -/PHP_CodeSniffer-3.3.1.tgz -/PHP_CodeSniffer-3.3.2.tgz -/PHP_CodeSniffer-3.4.0.tgz -/PHP_CodeSniffer-3.4.1.tgz -/PHP_CodeSniffer-3.4.2.tgz -/PHP_CodeSniffer-3.5.0.tgz -/PHP_CodeSniffer-3.5.1.tgz -/PHP_CodeSniffer-3.5.2.tgz -/PHP_CodeSniffer-3.5.3.tgz -/PHP_CodeSniffer-3.5.4.tgz -/PHP_CodeSniffer-3.5.5.tgz -/PHP_CodeSniffer-3.5.6.tgz -/PHP_CodeSniffer-3.5.8.tgz -/PHP_CodeSniffer-3.6.0.tgz -/PHP_CodeSniffer-3.6.1.tgz -/PHP_CodeSniffer-3.6.2.tgz -/PHP_CodeSniffer-3.7.0.tgz -/PHP_CodeSniffer-3.7.1.tgz -/PHP_CodeSniffer-3.7.2.tgz -/php-pear-PHP-CodeSniffer-3.8.0-5805f7a.tgz -/php-pear-PHP-CodeSniffer-3.8.1-14f5fff.tgz -/php-pear-PHP-CodeSniffer-3.9.0-d63cee4.tgz -/php-pear-PHP-CodeSniffer-3.9.1-267a440.tgz -/php-pear-PHP-CodeSniffer-3.9.2-aac1f6f.tgz -/php-pear-PHP-CodeSniffer-3.10.0-57e0980.tgz -/roundcubemail-1.5.7-complete.tar.gz -/php-pear-PHP-CodeSniffer-3.10.1-8f90f7a.tgz -/php-pear-PHP-CodeSniffer-3.10.2-86e5f5d.tgz -/php-pear-PHP-CodeSniffer-3.10.3-62d3299.tgz -/php-pear-PHP-CodeSniffer-3.11.0-70c08f8.tgz -/php-pear-PHP-CodeSniffer-3.11.1-19473c3.tgz -/php-pear-PHP-CodeSniffer-3.11.2-1368f4a.tgz -/php-pear-PHP-CodeSniffer-3.11.3-ba05f99.tgz -/php-pear-PHP-CodeSniffer-3.12.0-2d1b63d.tgz -/php-pear-PHP-CodeSniffer-3.12.1-ea16a1f.tgz -/php-pear-PHP-CodeSniffer-3.12.2-6d4cf60.tgz -/php-pear-PHP-CodeSniffer-3.13.0-65ff248.tgz -/php-pear-PHP-CodeSniffer-3.13.2-5b5e382.tgz +/php-pear-PHP-CodeSniffer-3.13.4-ad545ea.tgz diff --git a/php-pear-PHP-CodeSniffer.spec b/php-pear-PHP-CodeSniffer.spec index c6aab30..4357ec8 100644 --- a/php-pear-PHP-CodeSniffer.spec +++ b/php-pear-PHP-CodeSniffer.spec @@ -13,9 +13,9 @@ %bcond_without tests -%global gh_commit 5b5e3821314f947dd040c70f7992a64eac89025c +%global gh_commit ad545ea9c1b7d270ce0fc9cbfb884161cd706119 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_date 2025-06-17 +%global gh_date 2025-09-05 %global gh_owner PHPCSStandards %global gh_project PHP_CodeSniffer # keep in old PEAR tree @@ -23,8 +23,8 @@ Name: php-pear-PHP-CodeSniffer -Version: 3.13.2 -Release: 2%{?dist} +Version: 3.13.4 +Release: 1%{?dist} Summary: PHP coding standards enforcement tool License: BSD-3-Clause @@ -145,6 +145,9 @@ fi %changelog +* Mon Sep 8 2025 Remi Collet - 3.13.4-1 +- update to 3.13.4 + * Fri Jul 25 2025 Fedora Release Engineering - 3.13.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild diff --git a/sources b/sources index a651988..8a08523 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (php-pear-PHP-CodeSniffer-3.13.2-5b5e382.tgz) = 24ec9e9770103a46aecc8433b973bc496847f5e4be9c3b94a5184e5af62b4db1084053669ce7b4ac263b71166cbc2f8477862f1c9c5d406764001beaa412eedc +SHA512 (php-pear-PHP-CodeSniffer-3.13.4-ad545ea.tgz) = 2506f26e13632b84ac655ac3f5b993bf2227439dba5df528062a68feb8cc0c08724903932176e71b4148b514dd2facc8d226a99b4f046165b28b33b44c0c012f From 02dc3e6e4b9bb82a83e031c14543bba21c6494ba Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 15 Sep 2025 15:02:19 +0200 Subject: [PATCH 3/4] update to 4.0.0 raise dependency on PHP 7.2 switch to phpunit10 --- .gitignore | 2 +- ...-skip-tests-requiring-git-repository.patch | 41 ------------ php-pear-PHP-CodeSniffer-rpm.patch | 32 +++++---- php-pear-PHP-CodeSniffer.spec | 66 ++++++++++--------- sources | 2 +- 5 files changed, 57 insertions(+), 86 deletions(-) delete mode 100644 0001-skip-tests-requiring-git-repository.patch diff --git a/.gitignore b/.gitignore index 56db86d..83c478c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ clog -/php-pear-PHP-CodeSniffer-3.13.4-ad545ea.tgz +/php-pear-PHP-CodeSniffer-4.0.0-06113cf.tgz diff --git a/0001-skip-tests-requiring-git-repository.patch b/0001-skip-tests-requiring-git-repository.patch deleted file mode 100644 index d79dbd5..0000000 --- a/0001-skip-tests-requiring-git-repository.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 472b4f7c56dd95ca4469ed5aad6d6620aa13e03e Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 12 Jan 2024 08:25:58 +0100 -Subject: [PATCH] skip tests requiring git repository - ---- - tests/Core/Filters/GitModifiedTest.php | 3 +++ - tests/Core/Filters/GitStagedTest.php | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/tests/Core/Filters/GitModifiedTest.php b/tests/Core/Filters/GitModifiedTest.php -index 626fb6531..ca068e144 100644 ---- a/tests/Core/Filters/GitModifiedTest.php -+++ b/tests/Core/Filters/GitModifiedTest.php -@@ -211,6 +211,9 @@ final class GitModifiedTest extends AbstractFilterTestCase - */ - public function testExecAlwaysReturnsArray($cmd, $expected) - { -+ if (!is_dir(__DIR__ . '/../../../.git')) { -+ $this->markTestSkipped('Not a git repository'); -+ } - $fakeDI = new RecursiveArrayIterator(self::getFakeFileList()); - $filter = new GitModified($fakeDI, '/', self::$config, self::$ruleset); - -diff --git a/tests/Core/Filters/GitStagedTest.php b/tests/Core/Filters/GitStagedTest.php -index 0009aefa7..cf5f69765 100644 ---- a/tests/Core/Filters/GitStagedTest.php -+++ b/tests/Core/Filters/GitStagedTest.php -@@ -211,6 +211,9 @@ final class GitStagedTest extends AbstractFilterTestCase - */ - public function testExecAlwaysReturnsArray($cmd, $expected) - { -+ if (!is_dir(__DIR__ . '/../../../.git')) { -+ $this->markTestSkipped('Not a git repository'); -+ } - $fakeDI = new RecursiveArrayIterator(self::getFakeFileList()); - $filter = new GitStaged($fakeDI, '/', self::$config, self::$ruleset); - --- -2.43.0 - diff --git a/php-pear-PHP-CodeSniffer-rpm.patch b/php-pear-PHP-CodeSniffer-rpm.patch index 082cf2d..1d7032e 100644 --- a/php-pear-PHP-CodeSniffer-rpm.patch +++ b/php-pear-PHP-CodeSniffer-rpm.patch @@ -1,24 +1,32 @@ diff -up ./bin/phpcbf.rpm ./bin/phpcbf ---- ./bin/phpcbf.rpm 2024-04-02 07:58:25.996735959 +0200 -+++ ./bin/phpcbf 2024-04-02 07:59:09.906379098 +0200 -@@ -8,7 +8,7 @@ - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence +--- ./bin/phpcbf.rpm 2025-09-15 14:51:59.780439106 +0200 ++++ ./bin/phpcbf 2025-09-15 14:53:16.065234768 +0200 +@@ -21,10 +21,10 @@ */ --require_once __DIR__.'/../autoload.php'; -+include_once '/usr/share/pear/PHP/CodeSniffer/autoload.php'; + // Check if the PHP version and extensions comply with the minimum requirements before anything else. +-require_once dirname(__DIR__) . '/requirements.php'; ++require_once '/usr/share/pear/PHP/CodeSniffer/requirements.php'; + PHP_CodeSniffer\checkRequirements(); + +-require_once dirname(__DIR__) . '/autoload.php'; ++require_once '/usr/share/pear/PHP/CodeSniffer/autoload.php'; $runner = new PHP_CodeSniffer\Runner(); $exitCode = $runner->runPHPCBF(); diff -up ./bin/phpcs.rpm ./bin/phpcs ---- ./bin/phpcs.rpm 2024-04-02 07:58:25.996735959 +0200 -+++ ./bin/phpcs 2024-04-02 07:59:18.295693037 +0200 -@@ -8,7 +8,7 @@ - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence +--- ./bin/phpcs.rpm 2025-09-15 14:51:59.780522757 +0200 ++++ ./bin/phpcs 2025-09-15 14:52:52.535306647 +0200 +@@ -21,10 +21,10 @@ */ --require_once __DIR__.'/../autoload.php'; -+include_once '/usr/share/pear/PHP/CodeSniffer/autoload.php'; + // Check if the PHP version and extensions comply with the minimum requirements before anything else. +-require_once dirname(__DIR__) . '/requirements.php'; ++require_once '/usr/share/pear/PHP/CodeSniffer/requirements.php'; + PHP_CodeSniffer\checkRequirements(); + +-require_once dirname(__DIR__) . '/autoload.php'; ++require_once '/usr/share/pear/PHP/CodeSniffer/autoload.php'; $runner = new PHP_CodeSniffer\Runner(); $exitCode = $runner->runPHPCS(); diff --git a/php-pear-PHP-CodeSniffer.spec b/php-pear-PHP-CodeSniffer.spec index 4357ec8..5606a7c 100644 --- a/php-pear-PHP-CodeSniffer.spec +++ b/php-pear-PHP-CodeSniffer.spec @@ -13,31 +13,34 @@ %bcond_without tests -%global gh_commit ad545ea9c1b7d270ce0fc9cbfb884161cd706119 +%global gh_commit 06113cfdaf117fc2165f9cd040bd0f17fcd5242d %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_date 2025-09-05 +%global gh_date 2025-06-17 %global gh_owner PHPCSStandards %global gh_project PHP_CodeSniffer # keep in old PEAR tree %global pear_phpdir %{_datadir}/pear +%global upstream_version 4.0.0 +#global upstream_prever rc1 Name: php-pear-PHP-CodeSniffer -Version: 3.13.4 +Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} Release: 1%{?dist} Summary: PHP coding standards enforcement tool License: BSD-3-Clause URL: https://github.com/%{gh_owner}/%{gh_project} # git snapshot to retrieve test suite -Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz +Source0: %{name}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tgz Source1: makesrc.sh # RPM installation path Patch0: %{name}-rpm.patch BuildArch: noarch -BuildRequires: php(language) >= 5.4 +# 8.1 because of phpunit10 +BuildRequires: php(language) >= 8.1 BuildRequires: php-tokenizer BuildRequires: php-xmlwriter BuildRequires: php-simplexml @@ -47,17 +50,17 @@ BuildRequires: php-intl %if %{with tests} BuildRequires: php-bcmath # to run test suite, from composer.json "require-dev" -# "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" -%global phpunit %{_bindir}/phpunit9 -BuildRequires: phpunit9 >= 9.3.4 +# "phpunit/phpunit": "^8.0 || ^9.3.4 || ^10.5.32 || ^11.3.3" +%global phpunit %{_bindir}/phpunit10 +BuildRequires: phpunit10 >= 10.5.32 %endif # from composer.json "require": { -# "php": ">=5.4.0", +# "php": ">=7.2.0", # "ext-tokenizer": "*", # "ext-xmlwriter": "*", # "ext-simplexml": "*" -Requires: php(language) >= 5.4 +Requires: php(language) >= 7.2 Requires: php-tokenizer Requires: php-xmlwriter Requires: php-simplexml @@ -88,11 +91,12 @@ certain standards, such as PEAR, or user-defined. %install : Install the library -mkdir -p %{buildroot}%{pear_phpdir}/PHP/CodeSniffer -cp -pr src %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/src/ -cp -pr autoload.php %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/ -cp -p phpcs.xml.dist %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/ -cp -p phpcs.xsd %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/ +mkdir -p %{buildroot}%{pear_phpdir}/PHP/CodeSniffer +cp -pr src %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/src/ +cp -pr autoload.php %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/ +cp -pr requirements.php %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/ +cp -p phpcs.xml.dist %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/ +cp -p phpcs.xsd %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/ : Cleanup find %{buildroot}%{pear_phpdir}/PHP/CodeSniffer -depth -type d -name Tests -exec rm -r {} \; -print @@ -104,39 +108,34 @@ install -Dpm 755 bin/phpcbf %{buildroot}%{_bindir}/phpcbf %if %{with tests} %check -# fails with js: Couldn't read source file -rm src/Standards/Generic/Tests/Debug/JSHintUnitTest.* - # Fix current date YEAR=$(date +%Y) PREV=$(expr $YEAR - 1) sed -e "/@copyright/s/${PREV}/${YEAR}/" \ -i src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.*.fixed -# Version 3.11.2: Tests: 3174, Assertions: 18639, Warnings: 3, Skipped: 19. +# Version 4.0.0beta1: Tests: 3871, Assertions: 23018, PHPUnit Deprecations: 777, Skipped: 16. # testBrokenRulesetMultiError failing reported as https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/767 ret=0 -for cmdarg in "php %{phpunit}" php81 php82 php83 php84; do - if which $cmdarg; then +for cmdarg in \ + "php %{phpunit}" \ + "php81 %{_bindir}/phpunit10" \ + "php82 %{_bindir}/phpunit11" \ + "php83 %{_bindir}/phpunit11" \ + "php84 %{_bindir}/phpunit11" \ + "php85 %{_bindir}/phpunit11" + do if which $cmdarg; then set $cmdarg - $1 -d memory_limit=-1 ${2:-%{_bindir}/phpunit9} \ + $1 -d memory_limit=-1 $2 \ --filter '^((?!(testBrokenRulesetMultiError)).)*$' \ - || ret=1 + --no-coverage || ret=1 fi done exit $ret %endif -%post -# no more from pear channel -if [ -x %{_bindir}/pear ]; then - %{_bindir}/pear uninstall --nodeps --ignore-errors --register-only %{gh_project} >/dev/null || : -fi - - %files -%{!?_licensedir:%global license %%doc} %license licence.txt %doc *.md %{pear_phpdir}/PHP @@ -145,6 +144,11 @@ fi %changelog +* Mon Sep 15 2025 Remi Collet - 4.0.0-1 +- update to 4.0.0 +- raise dependency on PHP 7.2 +- switch to phpunit10 + * Mon Sep 8 2025 Remi Collet - 3.13.4-1 - update to 3.13.4 diff --git a/sources b/sources index 8a08523..7d442b2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (php-pear-PHP-CodeSniffer-3.13.4-ad545ea.tgz) = 2506f26e13632b84ac655ac3f5b993bf2227439dba5df528062a68feb8cc0c08724903932176e71b4148b514dd2facc8d226a99b4f046165b28b33b44c0c012f +SHA512 (php-pear-PHP-CodeSniffer-4.0.0-06113cf.tgz) = d82e79b05a1dd05638b71d4631b9b868987f581d200603725a91327b5b5dc8f20872910a5ec47c739662152d791cf99d930012c3ea63b549bbae210bd98c968c From e13e8ad2f6bddf7ca8fcf6095417826dcdcb0b4a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 12 Nov 2025 09:48:03 +0100 Subject: [PATCH 4/4] v4.0.1 --- .gitignore | 1 + php-pear-PHP-CodeSniffer.spec | 9 ++++++--- sources | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 83c478c..713d614 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ clog /php-pear-PHP-CodeSniffer-4.0.0-06113cf.tgz +/php-pear-PHP-CodeSniffer-4.0.1-0525c73.tgz diff --git a/php-pear-PHP-CodeSniffer.spec b/php-pear-PHP-CodeSniffer.spec index 5606a7c..1cc4cf5 100644 --- a/php-pear-PHP-CodeSniffer.spec +++ b/php-pear-PHP-CodeSniffer.spec @@ -13,15 +13,15 @@ %bcond_without tests -%global gh_commit 06113cfdaf117fc2165f9cd040bd0f17fcd5242d +%global gh_commit 0525c73950de35ded110cffafb9892946d7771b5 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_date 2025-06-17 +%global gh_date 2025-11-10 %global gh_owner PHPCSStandards %global gh_project PHP_CodeSniffer # keep in old PEAR tree %global pear_phpdir %{_datadir}/pear -%global upstream_version 4.0.0 +%global upstream_version 4.0.1 #global upstream_prever rc1 Name: php-pear-PHP-CodeSniffer @@ -144,6 +144,9 @@ exit $ret %changelog +* Wed Nov 12 2025 Remi Collet - 4.0.1-1 +- update to 4.0.1 + * Mon Sep 15 2025 Remi Collet - 4.0.0-1 - update to 4.0.0 - raise dependency on PHP 7.2 diff --git a/sources b/sources index 7d442b2..9acd652 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (php-pear-PHP-CodeSniffer-4.0.0-06113cf.tgz) = d82e79b05a1dd05638b71d4631b9b868987f581d200603725a91327b5b5dc8f20872910a5ec47c739662152d791cf99d930012c3ea63b549bbae210bd98c968c +SHA512 (php-pear-PHP-CodeSniffer-4.0.1-0525c73.tgz) = 384867fff733de98f3a0cd7105776aa571389e8f11a2d95ba51139a682778650900028722352779bb3b6986f61fa123ceded3d9496de0a05e0872ac21bb1329e