feat!: upgrade min. php version to 8.4 (#86)

* feat: upgrade min php to 7.4, upgrade packages

* chore: update ci/cd, docs, supporting config to php 8.4

* chore: update rest of the docs, supporting config to php 8.4
This commit is contained in:
2026-02-01 10:20:40 +02:00
committed by GitHub
parent 3d3448dcf0
commit 47564c5cd6
21 changed files with 348 additions and 356 deletions

View File

@@ -9,8 +9,8 @@ field-level configuration, and custom callbacks. It is designed for easy integra
## Coding Conventions
- **Language:** PHP 8.2+
- **PHP Version:** Ensure compatibility with PHP 8.2 and above.
- **Language:** PHP 8.4+
- **PHP Version:** Ensure compatibility with PHP 8.4 and above.
- **PSR Standards:** Follow PSR-12 for code style and autoloading.
- **Testing:** Use PHPUnit for all tests. Place tests in the `tests/` directory. Run `composer test` to execute tests.
- All tests should be written in a way that they can run independently.

View File

@@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ["8.2", "8.3", "8.4"]
php-version: ["8.4", "8.5"]
name: PHP ${{ matrix.php-version }}
@@ -71,7 +71,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: "8.2"
php-version: "8.4"
extensions: mbstring, xml, ctype, iconv, intl, json
tools: composer:v2
coverage: xdebug
@@ -100,7 +100,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: "8.2"
php-version: "8.4"
extensions: mbstring, xml, ctype, iconv, intl, json
tools: composer:v2

View File

@@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: "8.2"
php-version: "8.4"
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run PHP_CodeSniffer (PSR-12)

View File

@@ -24,7 +24,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: "8.2"
php-version: "8.4"
extensions: mbstring, xml, ctype, iconv, intl, json
tools: composer:v2

View File

@@ -25,7 +25,7 @@ jobs:
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
coverage: pcov
php-version: "8.2"
php-version: "8.4"
- name: Install dependencies
run: composer install --no-interaction --prefer-dist

1
.php-version Normal file
View File

@@ -0,0 +1 @@
8.4

View File

@@ -49,11 +49,6 @@ repos:
- id: actionlint
args: ["-shellcheck="]
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 42.84.0
hooks:
- id: renovate-config-validator
- repo: https://github.com/bridgecrewio/checkov.git
rev: "3.2.499"
hooks:

View File

@@ -82,7 +82,7 @@ The library can be integrated with Laravel in two ways:
## Code Standards
- **PHP 8.2+** with strict types
- **PHP 8.4+** with strict types
- **PSR-12** coding standard (enforced by PHP_CodeSniffer)
- **Psalm Level 5** static analysis with conservative configuration
- **PHPStan Level 6** for additional code quality insights

View File

@@ -24,7 +24,7 @@ Please be respectful in all interactions.
### Prerequisites
- PHP 8.2 or higher
- PHP 8.4 or higher
- Composer
- Git

View File

@@ -32,7 +32,7 @@ custom callbacks, and advanced features like streaming, rate limiting, and k-ano
## Requirements
- PHP 8.2 or higher
- PHP 8.4 or higher
- Monolog 3.x
## Installation
@@ -404,7 +404,7 @@ $processor = GdprProcessorBuilder::create()
`GdprProcessor::getDefaultPatterns()` includes patterns for:
| Category | Data Types |
|----------|------------|
| -------- | ---------- |
| Personal IDs | Finnish SSN (HETU), US SSN, Passport numbers, National IDs |
| Financial | Credit cards, IBAN, Bank account numbers |
| Contact | Email addresses, Phone numbers (E.164) |

View File

@@ -13,10 +13,10 @@
We actively support the following versions with security updates:
| Version | Supported | PHP Requirements |
| ------- | ------------------ | ---------------- |
| 2.x | Active support | PHP 8.2+ |
| 1.x | ⚠️ Security fixes only | PHP 8.2+ |
| Version | Supported | PHP Requirements |
| ------- | -------------------- | ---------------- |
| 2.x | Active support | PHP 8.4+ |
| 1.x | Security fixes only | PHP 8.4+ |
## Security Features

View File

@@ -9,7 +9,7 @@ This file tracks remaining issues, improvements, and feature requests for the mo
- **141 PHP files** (60 source files, 81 test files)
- **1,346 tests** with **100% success rate** (3,386 assertions)
- **85.07% line coverage**, **88.31% method coverage**
- **PHP 8.2+** with modern language features and strict type safety
- **PHP 8.4+** with modern language features and strict type safety
- **Zero Critical Issues**: All functionality-blocking bugs resolved
- **Static Analysis**: All tools pass cleanly (Psalm, PHPStan, Rector, PHPCS)

View File

@@ -31,11 +31,11 @@
"lint:tool:psalm": "./vendor/bin/psalm --show-info=true",
"lint:tool:psalm:fix": "./vendor/bin/psalm --alter --issues=MissingReturnType,MissingParamType,MissingClosureReturnType",
"lint:tool:rector": "./vendor/bin/rector",
"lint:tool:md:fix": "markdownlint -f '**/*.md'",
"lint:tool:md": "markdownlint '**/*.md'"
"lint:tool:md:fix": "npx -y markdownlint-cli -f '**/*.md'",
"lint:tool:md": "npx -y markdownlint-cli '**/*.md'"
},
"require": {
"php": "^8.2",
"php": "^8.4",
"monolog/monolog": "^3.0",
"adbario/php-dot-notation": "^3.3"
},

634
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
FROM php:8.2-cli-alpine
FROM php:8.4-cli-alpine
# Install system dependencies
RUN apk add --no-cache \

View File

@@ -26,7 +26,7 @@ docker compose exec php composer lint
### docker/Dockerfile
```dockerfile
FROM php:8.2-cli-alpine
FROM php:8.4-cli-alpine
# Install system dependencies
RUN apk add --no-cache \
@@ -90,9 +90,9 @@ services:
tty: true
command: tail -f /dev/null
# Optional: PHP 8.3 for testing compatibility
# Optional: PHP 8.5 for testing compatibility
php83:
image: php:8.3-cli-alpine
image: php:8.5-cli-alpine
volumes:
- ..:/app
working_dir: /app
@@ -253,7 +253,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.2', '8.3']
php: ['8.4', '8.5']
steps:
- uses: actions/checkout@v4

View File

@@ -28,7 +28,7 @@ Plugins extend the GDPR processor's functionality without modifying core code. U
### When to Use Plugins vs. Configuration
| Scenario | Use Plugin | Use Configuration |
|----------|-----------|-------------------|
| -------- | --------- | ----------------- |
| Add regex patterns | ✅ (via `getPatterns()`) | ✅ (via constructor) |
| Custom transformation logic | ✅ | ❌ |
| Conditional processing | ✅ | ❌ |
@@ -126,7 +126,7 @@ interface MaskingPluginInterface
### Method Reference
| Method | Purpose | When Called |
|--------|---------|-------------|
| ------ | ------- | ----------- |
| `getName()` | Unique identifier for debugging | On registration |
| `preProcessContext()` | Modify context before masking | Before core masking |
| `preProcessMessage()` | Modify message before masking | Before core masking |
@@ -266,7 +266,7 @@ class LowPriorityPlugin extends AbstractMaskingPlugin
### Recommended Priority Ranges
| Range | Use Case | Example |
|-------|----------|---------|
| ----- | -------- | ------- |
| 1-50 | Security/validation | Input sanitization |
| 50-100 | Standard processing | Pattern masking |
| 100-150 | Business logic | Domain-specific rules |

View File

@@ -22,7 +22,7 @@ This guide helps diagnose and resolve common issues with the Monolog GDPR Filter
```bash
# Check PHP version
php -v # Must be 8.2 or higher
php -v # Must be 8.4 or higher
# Clear Composer cache
composer clear-cache

View File

@@ -91,7 +91,7 @@ parameters:
- '#Constant Tests\\.*::.* is unused#'
# PHP version for analysis
phpVersion: 80200
phpVersion: 80400
# Stub files for missing functions/classes
stubFiles: []

View File

@@ -4,7 +4,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
phpVersion="8.2"
phpVersion="8.4"
noCache="false"
findUnusedPsalmSuppress="true"
skipChecksOnUnresolvableIncludes="true"

View File

@@ -57,7 +57,7 @@ return RectorConfig::configure()
removeUnusedImports: true, // This is generally safe
)
// Conservative PHP version targeting
->withPhpVersion(80200)
->withPhpVersion(80400)
// Don't use prepared sets - they're too aggressive
->withPreparedSets(
deadCode: false, // Disable dead code removal