[IP-696]: fix: require PHP ^8.4 to match CI and mb_str_functions usage - #697
Conversation
…Plane#696) composer.json declared PHP ^8.3, but pint.json enables mb_str_functions (mb_trim/mb_ltrim/mb_rtrim, added in PHP 8.4) and every CI workflow pins php-version 8.4. Installing on real PHP 8.3.x would fatal on any of the existing mb_trim() call sites. Bumps the composer constraint and README requirements to 8.4 to match what the project actually needs.
📝 WalkthroughWalkthroughThe minimum supported PHP version changes from 8.3 to 8.4 in ChangesPHP 8.4 support alignment
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Line 4: Align the README PHP badge with the Composer constraint by changing
the badge text near the PHP Version link to indicate PHP 8.4–8.x, preserving the
existing badge URL and link.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9a1f619d-7ea7-406b-82f2-c376be2b76e2
📒 Files selected for processing (2)
README.mdcomposer.json
|
|
||
| [](https://opensource.org/licenses/MIT) | ||
| [](https://php.net) | ||
| [](https://php.net) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files | rg '(^|/)(README\.md|composer\.(json|lock))$' || true
echo "== composer.json =="
if [ -f composer.json ]; then
cat -n composer.json | sed -n '1,80p'
fi
echo "== composer.lock platform constraints (if present) =="
if [ -f composer.lock ]; then
python3 - <<'PY'
import json
p='composer.lock'
with open(p) as f:
data=json.load(f)
print('platform:', data.get('platform','not set'))
print('platform-dev:', data.get('platform-dev','not set'))
print('has platform overrides:', data.get('platform-overrides','not set'))
PY
fi
echo "== README relevant lines =="
if [ -f README.md ]; then
cat -n README.md | sed -n '1,60p'
fi
echo "== search PHP version mentions =="
rg -n "PHP|php|8\.4|8\.5|9\.0|composer\.json|require|platform" -S . --glob 'README.md' --glob 'composer.json' --glob 'composer.lock' || trueRepository: InvoicePlane/InvoicePlane-v2
Length of output: 50387
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== composer.json =="
if [ -f composer.json ]; then
python3 - <<'PY'
import json
with open('composer.json') as f:
data=json.load(f)
for key in ['require','require-dev','suggest','config','platform','scripts']:
if key in data:
print(json.dumps({key:data[key]}, indent=2, sort_keys=True))
PY
fi
echo "== composer.lock platform fields =="
if [ -f composer.lock ]; then
python3 - <<'PY'
import json
with open('composer.lock') as f:
data=json.load(f)
print({
"platform": data.get("platform"),
"platform-dev": data.get("platform-dev"),
"platform-overrides": data.get("platform-overrides")
})
PY
fi
echo "== exact composer and package manifests for PHP version constraints =="
rg -n '"php"|"RequirePHP"|"requires_ph[pa]p|requiresPHP|RequirePhp|php [=<>]|PHP [=<>]' -S composer.json README.md composer.lock || true
echo "== README PHP line context =="
if [ -f README.md ]; then
nl -ba README.md | sed -n '4p;45,50p'
fiRepository: InvoicePlane/InvoicePlane-v2
Length of output: 12442
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== inspect relevant repository files =="
git ls-files | rg '(^|/)(README\.md|composer\.(json|lock))$' || true
printf '\n'
if [ -f composer.json ]; then
printf '%s\n' '== composer.json (first 120 lines) =='
cat -n composer.json | sed -n '1,120p'
printf '\n'
fi
if [ -f composer.lock ]; then
printf '%s\n' '== composer.lock platform fields =='
python3 - <<'PY'
import json
with open('composer.lock') as f:
data=json.load(f)
print({
"platform": data.get("platform"),
"platform-dev": data.get("platform-dev"),
"platform-overrides": data.get("platform-overrides")
})
PY
printf '\n'
fi
if [ -f README.md ]; then
printf '%s\n' '== README.md (first 80 lines) =='
cat -n README.md | sed -n '1,80p'
printf '\n'
fi
echo "== focused PHP/require search =="
rg -n '"php"|"php[ =<>]|PHP 8\.4|PHP 9\.0|Requires PHP|require:"|platform:"|platform-dev:"' -S composer.json README.md composer.lock || trueRepository: InvoicePlane/InvoicePlane-v2
Length of output: 17914
Align README with the Composer PHP range.
^8.4 on composer.json:20 only permits PHP >=8.4.0 <9.0.0. Change README.md:4 to PHP 8.4–8.x or update the Composer constraint to support later PHP versions.
Also applies to: 47-47
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@README.md` at line 4, Align the README PHP badge with the Composer constraint
by changing the badge text near the PHP Version link to indicate PHP 8.4–8.x,
preserving the existing badge URL and link.
Summary
composer.jsondeclared"php": "^8.3", butpint.jsonenablesmb_str_functions(mb_trim/mb_ltrim/mb_rtrim, added in PHP 8.4) and every GitHub Actions workflow pinsphp-version: '8.4'.^8.3) would fatal the first time one of the existingmb_trim()call sites executes (Contact::getFullNameAttribute(),Numbering,NumberingService,InvoicesTable).^8.4and updates the README's stated PHP requirement to match, so the declared minimum finally reflects what the project actually needs.Test plan
composer validate— schema valid; pre-existing lock-file staleness warning is unrelated to this change (reproduces identically ondevelopbefore this PR, caused by unrelated dependency conflicts:laravel/pintpinned to a stale dev-branch ref, and adompdf/roave/security-advisoriesversion conflict — out of scope here)composer install --dry-runsucceeds on the current platformFixes #696
Summary by CodeRabbit
Documentation
Chores