Skip to content

Commit 4b6313e

Browse files
authored
Merge pull request #10 from mambax7/feature/PHP8.2
Feature/php8.2
2 parents 9d45bd7 + e8f2d44 commit 4b6313e

14 files changed

Lines changed: 39 additions & 64 deletions

.github/copilot-instructions.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ src/ # Library source code
1414
PslCacheNotFoundException.php # Thrown when no valid PSL cache is found
1515
bin/
1616
update-psl.php # Downloads and caches the Mozilla PSL (atomic writes, HTTP conditional)
17-
reloadpsl # Shell wrapper to force PSL reload
1817
data/
1918
psl.cache.php # Bundled PSL cache (PHP array with NORMAL/WILDCARD/EXCEPTION keys)
2019
psl.meta.json # HTTP metadata (ETag, Last-Modified) for conditional downloads
@@ -39,7 +38,7 @@ composer update-psl # Download fresh Mozilla Public Suffix List
3938

4039
## PHP Compatibility
4140

42-
Code must run on PHP 7.4 through 8.5. Do not use features exclusive to PHP 8.0+ (named arguments, match expressions, union type hints in signatures, enums, fibers, readonly properties, intersection types, `never` return type, first-class callable syntax).
41+
Code must run on PHP 8.2 through 8.5. PHP 8.2+ language features are available: union types, named arguments, `match` expressions, enums, `readonly`, constructor promotion, intersection types, `never` return type, first-class callable syntax, and `#[Attribute]` syntax.
4342

4443
## Key Architecture
4544

@@ -97,7 +96,7 @@ XOOPS has two major generations with different APIs. Code must support both:
9796

9897
1. Code follows PSR-12 and passes `composer lint`.
9998
2. Static analysis passes `composer analyse` with no new errors.
100-
3. Tests pass on all supported PHP versions (7.4-8.5).
99+
3. Tests pass on all supported PHP versions (8.2-8.5).
101100
4. New public methods have PHPDoc with `@param`, `@return`, and `@throws` tags.
102101
5. New functionality has corresponding unit tests.
103102
6. Changes are documented in the changelog.

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@ jobs:
1414
matrix:
1515
include:
1616
# Lowest supported dependencies test
17-
- php: "7.4"
17+
- php: "8.2"
1818
deps: "lowest"
1919
# Standard tests across all supported versions
20-
- php: "7.4"
21-
- php: "8.0"
22-
- php: "8.1"
2320
- php: "8.2"
2421
- php: "8.3"
2522
- php: "8.4"

.scrutinizer.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
build:
2+
environment:
3+
php: 8.2
24
nodes:
35
analysis:
46
tests:

CHANGELOG.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
55

6-
## [2.0.2-beta3] - 2026-02-08
6+
## [2.1.0-beta1] - 2026-02-22
7+
8+
### Breaking Changes
9+
10+
* Require PHP 8.2 as minimum version (was PHP 7.4); remove `symfony/polyfill-php80` and `symfony/polyfill-mbstring` polyfill dependencies
11+
* Require `ext-mbstring` as a hard dependency (was provided by polyfill)
12+
* Remove `bin/reloadpsl` convenience script entirely — invoke `bin/update-psl.php` directly instead
13+
* Require PHPUnit `^11.0` only (was `^9.6 || ^10.0 || ^11.0`)
714

815
### Bug Fixes
916
* Fix `getPublicSuffix()` PSL exception-rule handling — exception branch returned one label too many; now correctly returns the exception rule minus its leftmost label (e.g. `!city.kawasaki.jp` yields public suffix `kawasaki.jp`, not `city.kawasaki.jp`)
@@ -13,7 +20,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
1320
* Fix `normalizeDomain()` crash on empty string — `idn_to_ascii('')` throws `ValueError` on PHP 8.4+; added `$domain !== ''` guard
1421
* Fix PSL exception tests referencing `parliament.uk` (removed from the PSL); replaced with stable entries (`www.ck`, `city.kawasaki.jp`)
1522
* Fix `bin/update-psl.php` failing when run standalone on PHP 7.4 — `str_starts_with()` was called without loading the polyfill autoloader
16-
* Fix `bin/reloadpsl` calling removed methods (`clearDataDirectory()`, `getTree()`); rewritten as a simple wrapper
1723
* Fix `getMetadata()` unreachable statement
1824

1925
### Security
@@ -24,13 +30,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
2430

2531
### Changed
2632
* Make `normalizeDomain()` a `private static` method (was instance method)
27-
* Replace `strpos()`/`substr()` patterns with `str_contains()`/`str_starts_with()`/`str_ends_with()` via `symfony/polyfill-php80`
33+
* Replace `strpos()`/`substr()` patterns with `str_contains()`/`str_starts_with()`/`str_ends_with()` (native in PHP 8.0)
2834
* Add `@throws PslCacheNotFoundException` PHPDoc tags to `PublicSuffixList::__construct()` and `loadRules()`
2935
* Add XOOPS copyright headers to all source files
3036
* Clarify `README.md` license section — library code is Apache-2.0, bundled PSL data is MPL-2.0
3137

3238
### Added
33-
* Add `symfony/polyfill-php80` dependency for `str_contains`, `str_starts_with`, `str_ends_with` on PHP 7.4
3439
* Add `ext-intl` to `suggest` in `composer.json`
3540

3641
### Tests
@@ -49,14 +54,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
4954
* Add Composer autoloader bootstrap to `bin/update-psl.php` for standalone execution
5055
* Add `composer ci` script chaining lint + analyse + test
5156
* Add `composer update-psl` and `auto-update-psl` scripts with `XOOPS_SKIP_PSL_UPDATE` support
52-
* Add GitHub Actions CI workflow — PHP 7.4–8.5 matrix, lowest-deps on 7.4, coverage on 8.3
57+
* Update GitHub Actions CI matrix from PHP 7.4–8.5 to PHP 8.2–8.5; lowest-deps on 8.2, coverage on 8.3
5358
* Fix CI coverage matrix entry running tests twice — added `if: !matrix.coverage` guard
5459
* Fix SonarCloud workflow using `secrets` context in step-level `if:` — moved to job-level `env`
5560
* Add GitHub Copilot custom instructions (`.github/copilot-instructions.md`)
5661
* Add Dependabot configuration for Composer and GitHub Actions
5762
* Add Qodana static analysis workflow
5863
* Add `.editorconfig` (UTF-8, LF, PSR-12 indentation)
59-
* Remove `xsi:noNamespaceSchemaLocation` from `phpunit.xml.dist` to avoid XSD validation warnings on PHPUnit 9; `<source>` element works natively on PHPUnit 10+/11+
64+
* Convert test `@dataProvider` annotations to PHPUnit 11 `#[DataProvider]` attributes
65+
* Convert test `@requires` annotations to `#[RequiresPhpExtension]` attributes
66+
* Add PHPUnit 11 XSD schema and `cacheDirectory` to `phpunit.xml.dist`
6067
* Standardize `.gitattributes` with LF enforcement and export-ignore list
6168
* Standardize `.gitignore` with local config overrides, build artifacts, PHPUnit cache
6269
* Track `phpcs.xml` in version control (was previously untracked, causing CI lint failure)
@@ -173,7 +180,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
173180
* Import Florian Sager's regdom-php library (Synchro/Marcus Bointon)
174181
* PHP include file for domain registration data (Synchro/Marcus Bointon)
175182

176-
[2.0.2-beta3]: https://github.com/XOOPS/RegDom/compare/v2.0.2-beta2...HEAD
183+
[2.1.0-beta1]: https://github.com/XOOPS/RegDom/compare/v2.0.2-beta2...HEAD
177184
[2.0.2-beta2]: https://github.com/XOOPS/RegDom/compare/v2.0.2-beta1...v2.0.2-beta2
178185
[2.0.2-beta1]: https://github.com/XOOPS/RegDom/compare/v2.0.1...v2.0.2-beta1
179186
[2.0.1]: https://github.com/XOOPS/RegDom/compare/v2.0.0...v2.0.1

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ For more information on public suffixes, see [publicsuffix.org](https://publicsu
1010

1111
## Requirements
1212

13-
- PHP 7.4 or later
13+
- PHP 8.2 or later
14+
- `ext-mbstring` required
1415
- `ext-intl` recommended (for internationalized domain name support)
1516

1617
## Installation

bin/reloadpsl

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

bin/update-psl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @source https://publicsuffix.org/
1414
*/
1515

16-
// Load Composer autoloader (provides polyfills for PHP 7.4)
16+
// Load Composer autoloader
1717
foreach ([__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php'] as $autoload) {
1818
if (file_exists($autoload)) {
1919
require_once $autoload;

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@
2929
}
3030
],
3131
"require": {
32-
"php": "^7.4 || ^8.0",
33-
"symfony/polyfill-mbstring": "^1.33",
34-
"symfony/polyfill-php80": "^1.33"
32+
"php": "^8.2",
33+
"ext-mbstring": "*"
3534
},
3635
"require-dev": {
3736
"phpstan/phpstan": "^1.10 || ^2.0",
38-
"phpunit/phpunit": "^9.6 || ^10.0 || ^11.0",
37+
"phpunit/phpunit": "^11.0",
3938
"roave/security-advisories": "dev-latest",
4039
"squizlabs/php_codesniffer": "^3.11"
4140
},

docs/architecture.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ src/
1313
PslCacheNotFoundException.php Thrown when no valid cache is found
1414
bin/
1515
update-psl.php Downloads PSL from publicsuffix.org, builds cache
16-
reloadpsl Convenience wrapper for update-psl.php
1716
data/
1817
psl.cache.php Bundled PSL cache (PHP array, ~200 KB)
1918
psl.meta.json Download metadata (ETag, Last-Modified)

phpunit.xml.dist

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!--
3-
Uses <source> (PHPUnit 10.1+) for code-coverage source filtering.
4-
PHPUnit 9.6 (PHP 7.4/8.0) ignores this element harmlessly; coverage is only
5-
collected on PHP 8.3 (PHPUnit 10+) in CI, so the filter is always effective
6-
when it matters.
7-
8-
The xsi:noNamespaceSchemaLocation attribute is intentionally omitted to avoid
9-
XSD validation warnings on PHPUnit 9, which does not recognise <source>.
10-
-->
11-
<phpunit bootstrap="vendor/autoload.php"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
125
colors="true"
6+
cacheDirectory=".phpunit.cache"
137
failOnRisky="true"
148
failOnWarning="true">
159
<testsuites>

0 commit comments

Comments
 (0)