From 4bfda589469ed239fe682913bcf86f58275af471 Mon Sep 17 00:00:00 2001 From: csemazharul <54615735+csemazharul@users.noreply.github.com> Date: Mon, 2 Nov 2026 12:30:36 +0600 Subject: [PATCH] chore: raise minimum PHP version to 7.4 Update composer.json, the Rector PHP version and set, and CLAUDE.md. The composer compat script already targets 7.4. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 4 ++-- composer.json | 2 +- rector.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index d9695a8..193e024 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co `bitapps/wp-validator` — a Composer library (PSR-4: `BitApps\WPValidator\` → [src/](src/)) providing Laravel-style validation and sanitization for WordPress. Public API and the full rule list are documented in [README.md](README.md); update it when adding a rule or sanitizer. -**PHP 7.2 is the floor.** No typed properties, no arrow functions, no null coalescing assignment, no union types. Return types on methods are used and fine. [rector.php](rector.php) pins `PhpVersion::PHP_72` and skips the typed-property rectors for this reason. +**PHP 7.4 is the floor.** No union types or other PHP 8+ syntax. Return types on methods are used and fine. [rector.php](rector.php) pins `PhpVersion::PHP_74` and skips the typed-property rectors. ## Commands @@ -14,7 +14,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co composer test:unit # full suite (Pest, --testdox, excludes group 'db') ./vendor/bin/pest tests/Rules/BetweenTest.php # single file ./vendor/bin/pest --filter='between accepts a length of zero' # single test by name -composer compat # PHPCompatibility check against PHP 7.2 +composer compat # PHPCompatibility check against PHP 7.4 composer rector # Rector dry-run (never auto-applies) ``` diff --git a/composer.json b/composer.json index 251ed5c..7956bd3 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ }, "require": { - "php": ">=7.2" + "php": ">=7.4" }, "require-dev": { "pestphp/pest": "^2.18", diff --git a/rector.php b/rector.php index f815ed8..a808ff6 100644 --- a/rector.php +++ b/rector.php @@ -13,7 +13,7 @@ ->withPaths([ __DIR__ . '/src', ]) - ->withPhpVersion(PhpVersion::PHP_72) + ->withPhpVersion(PhpVersion::PHP_74) ->withSkip([ UnwrapFutureCompatibleIfPhpVersionRector::class, TypedPropertyFromStrictConstructorRector::class, @@ -29,4 +29,4 @@ // strictBooleans: true, // naming: true, ) - ->withSets([SetList::PHP_72]); + ->withSets([SetList::PHP_74]);