Skip to content

Commit 6d9207c

Browse files
authored
build(php): Raise minimum version to 8.4 (#60)
Move the supported PHP floor from 8.3 to 8.4 across the toolchain. Drop 8.3 from the CI matrix (now 8.4 and 8.5), bump the Docker image, phpstan and rector targets, and align every version reference in the README, docs site, and contributor guides. Revert an experimental 8.5 pipe operator in nameFix back to the typed one-liner so the code runs on the 8.4 floor. Also tighten the removeAccents benchmark surfaced by static analysis: guard the str_repeat count as a non-negative int and fold each result into a printed checksum so the pure calls cannot be optimised away. Signed-off-by: Marjo Wenzel van Lier <[email protected]>
1 parent 89ef147 commit 6d9207c

16 files changed

Lines changed: 41 additions & 34 deletions

.coderabbit.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# yaml-language-server: $schema=https://docs.coderabbit.ai/schema/schema.v2.json
33

44
# CodeRabbit Configuration
5-
# StringManipulation PHP 8.3+ Library
5+
# StringManipulation PHP 8.4+ Library
66
# Enforces strict quality standards: PHPStan MAX, SOLID principles, PER-CS2.0
77

88
# Language and Tone
@@ -54,8 +54,8 @@ reviews:
5454
Review PHP code for adherence to PER Coding Style 2.0 guidelines.
5555
Ensure proper namespace usage, code organisation, and separation
5656
of concerns. Verify that SOLID principles are followed and
57-
encourage FOOP techniquessuch as immutable data, pure functions,
58-
and functional compositionto improve maintainability,
57+
encourage FOOP techniques (such as immutable data, pure functions,
58+
and functional composition) to improve maintainability,
5959
testability, and performance.
6060
6161
Specific checks:
@@ -64,7 +64,7 @@ reviews:
6464
- Final classes with static methods where appropriate
6565
- Comprehensive docblocks with @param, @return, and @example tags
6666
- No methods exceeding 100 lines (PHPMD rule)
67-
- PHP 8.3+ features and patterns
67+
- PHP 8.4+ features and patterns
6868
- Proper error handling and null safety
6969
7070
- path: "tests/**/*.php"

.github/workflows/codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
with:
1010
fetch-depth: 0
1111

12-
- name: Set up php 8.3
12+
- name: Set up php 8.4
1313
uses: shivammathur/setup-php@v2
1414
with:
15-
php-version: "8.3"
15+
php-version: "8.4"
1616
extensions: mbstring, xml, zip, pdo_mysql, xhprof
1717

1818
- name: Install dependencies

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
php-versions: ["8.3", "8.4", "8.5"]
18+
php-versions: ["8.4", "8.5"]
1919

2020
steps:
2121
# This step checks out a copy of your repository.

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
High-performance PHP 8.3+ string manipulation library with zero production dependencies. Single final class (`StringManipulation`) exposing static methods optimised with pre-computed character mappings for O(1) lookups via `strtr()`.
7+
High-performance PHP 8.4+ string manipulation library with zero production dependencies. Single final class (`StringManipulation`) exposing static methods optimised with pre-computed character mappings for O(1) lookups via `strtr()`.
88

99
## Build & Test Commands
1010

11-
**Always use Docker** to ensure consistent PHP 8.3 + AST extension environment.
11+
**Always use Docker** to ensure consistent PHP 8.4 + AST extension environment.
1212

1313
| Task | Docker | Local |
1414
|------|--------|-------|
@@ -82,4 +82,4 @@ Mutation testing target MSI: 88%.
8282

8383
## CI
8484

85-
GitHub Actions runs the test matrix against PHP 8.3, 8.4, and 8.5 with vulnerability scanning (osv-scanner + Enlightn).
85+
GitHub Actions runs the test matrix against PHP 8.4 and 8.5 with vulnerability scanning (osv-scanner + Enlightn).

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Thank you for your interest in contributing to StringManipulation! This document
88

99
- Docker and Docker Compose
1010
- Git
11-
- PHP 8.3+ (optional, only for local development without Docker)
11+
- PHP 8.4+ (optional, only for local development without Docker)
1212

1313
### Setting Up Pre-commit Hooks
1414

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.3-cli-alpine
1+
FROM php:8.4-cli-alpine
22

33
# Install system dependencies
44
RUN apk add --no-cache \

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
## Introduction
1717

18-
Welcome to the `StringManipulation` library, a high-performance PHP 8.3+ toolkit designed for complex and efficient
18+
Welcome to the `StringManipulation` library, a high-performance PHP 8.4+ toolkit designed for complex and efficient
1919
string handling. Following a recent suite of O(n) optimisations, the library is now **2-5x faster**, making it one of
2020
the most powerful and reliable solutions for developers who require speed and precision in their PHP applications.
2121

@@ -201,7 +201,7 @@ of tools to ensure stability and correctness.
201201

202202
### Docker-Based Testing (Recommended)
203203

204-
For a consistent and reliable testing environment, we recommend using Docker. Our Docker setup includes PHP 8.3 with all
204+
For a consistent and reliable testing environment, we recommend using Docker. Our Docker setup includes PHP 8.4 with all
205205
required extensions:
206206

207207
```bash
@@ -217,7 +217,7 @@ docker-compose run --rm test-infection # Mutation testing
217217

218218
### Local Testing
219219

220-
If you have a local PHP 8.3+ environment configured:
220+
If you have a local PHP 8.4+ environment configured:
221221

222222
```bash
223223
# Complete test suite
@@ -243,7 +243,7 @@ composer tests
243243

244244
## System Requirements
245245

246-
- **PHP 8.3 or later** (strict typing enabled)
246+
- **PHP 8.4 or later** (strict typing enabled)
247247
- **`mbstring` extension** for multi-byte string operations
248248
- **`intl` extension** for internationalisation and advanced Unicode support
249249
- **Enabled `declare(strict_types=1);`** for robust type safety

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "marjovanlier/stringmanipulation",
3-
"description": "High-performance PHP 8.3+ string manipulation library featuring O(n) algorithms with up to 5x speed improvements. Provides Unicode-aware operations including searchWords(), nameFix(), utf8Ansi(), removeAccents(), and isValidDate() with comprehensive testing infrastructure.",
3+
"description": "High-performance PHP 8.4+ string manipulation library featuring O(n) algorithms with up to 5x speed improvements. Provides Unicode-aware operations including searchWords(), nameFix(), utf8Ansi(), removeAccents(), and isValidDate() with comprehensive testing infrastructure.",
44
"keywords": [
55
"string manipulation",
66
"performance",
@@ -43,7 +43,7 @@
4343
},
4444
"minimum-stability": "stable",
4545
"require": {
46-
"php": "^8.3"
46+
"php": "^8.4"
4747
},
4848
"require-dev": {
4949
"enlightn/security-checker": ">=2.0",
@@ -72,7 +72,7 @@
7272
"test:phpstan": "Perform advanced static analysis with PHPStan for type checking, null safety, and logic validation",
7373
"test:pest": "Run comprehensive Pest test suite with mutation testing, strict type checking and edge case coverage",
7474
"test:psalm": "Execute Psalm static analysis for advanced type inference, purity checking, and security validation",
75-
"test:rector": "Analyse code for modernisation opportunities and PHP 8.3+ feature adoption using Rector rules",
75+
"test:rector": "Analyse code for modernisation opportunities and PHP 8.4+ feature adoption using Rector rules",
7676
"test:vulnerabilities-check": "Scan all dependencies for known CVE vulnerabilities and security advisories using Enlightn Security Checker",
7777
"fix:code-style": "Automatically fix code style issues with Pint",
7878
"fix:rector": "Apply Rector refactorings to improve code quality",

docs/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Site settings
22
title: StringManipulation
3-
description: High-performance PHP 8.3+ string manipulation library featuring O(n) algorithms with up to 5x speed improvements
3+
description: High-performance PHP 8.4+ string manipulation library featuring O(n) algorithms with up to 5x speed improvements
44
baseurl: "/StringManipulation"
55
url: "https://marjovanlier.github.io"
66

docs/contributing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ We welcome contributions to the StringManipulation library! Whether you're fixin
2424

2525
### Prerequisites
2626

27-
- PHP 8.3 or later
27+
- PHP 8.4 or later
2828
- Docker and Docker Compose (recommended for testing)
2929
- Git
3030
- Composer
@@ -84,7 +84,7 @@ Use descriptive branch names:
8484
### PHP Standards
8585

8686
- **Strict typing**: All files must include `declare(strict_types=1);`
87-
- **PHP 8.3+**: Use modern PHP features
87+
- **PHP 8.4+**: Use modern PHP features
8888
- **PSR-4 autoloading**: Follow namespace conventions
8989
- **Final classes**: Prefer final classes with static methods
9090
- **Typed parameters**: Always use explicit type declarations

0 commit comments

Comments
 (0)