Skip to content

[IP-696]: fix: require PHP ^8.4 to match CI and mb_str_functions usage - #697

Merged
nielsdrost7 merged 1 commit into
InvoicePlane:developfrom
KhawarMehfooz:696/fix-php-version-mismatch
Jul 31, 2026
Merged

[IP-696]: fix: require PHP ^8.4 to match CI and mb_str_functions usage#697
nielsdrost7 merged 1 commit into
InvoicePlane:developfrom
KhawarMehfooz:696/fix-php-version-mismatch

Conversation

@KhawarMehfooz

@KhawarMehfooz KhawarMehfooz commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • 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 GitHub Actions workflow pins php-version: '8.4'.
  • Installing on a real PHP 8.3.x runtime (explicitly allowed by ^8.3) would fatal the first time one of the existing mb_trim() call sites executes (Contact::getFullNameAttribute(), Numbering, NumberingService, InvoicesTable).
  • Bumps the composer constraint to ^8.4 and 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 on develop before this PR, caused by unrelated dependency conflicts: laravel/pint pinned to a stale dev-branch ref, and a dompdf/roave/security-advisories version conflict — out of scope here)
  • composer install --dry-run succeeds on the current platform
  • Existing PHPUnit tests still pass

Fixes #696

Summary by CodeRabbit

  • Documentation

    • Updated the documented minimum supported PHP version to 8.4.
  • Chores

    • Updated the project’s platform requirement to require PHP 8.4 or newer.

…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.
@KhawarMehfooz KhawarMehfooz changed the title fix: require PHP ^8.4 to match CI and mb_str_functions usage [IP-696]: fix: require PHP ^8.4 to match CI and mb_str_functions usage Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The minimum supported PHP version changes from 8.3 to 8.4 in composer.json and README.md.

Changes

PHP 8.4 support alignment

Layer / File(s) Summary
Update PHP version requirements
composer.json, README.md
Composer now requires PHP ^8.4. The README badge and requirements list now state PHP 8.4 or higher.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: nielsdrost7

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes update composer.json and README.md to require PHP ^8.4, resolving issue #696’s declared-version mismatch.
Out of Scope Changes check ✅ Passed The changes are limited to the PHP version requirement and its README documentation, which are within issue #696’s scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the PHP requirement change and its alignment with CI and PHP 8.4 string-function usage.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between decacfa and 618be81.

📒 Files selected for processing (2)
  • README.md
  • composer.json

Comment thread README.md

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PHP Version](https://img.shields.io/badge/PHP-8.3%2B-blue.svg)](https://php.net)
[![PHP Version](https://img.shields.io/badge/PHP-8.4%2B-blue.svg)](https://php.net)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ 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' || true

Repository: 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'
fi

Repository: 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 || true

Repository: 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.

@nielsdrost7
nielsdrost7 merged commit 2e88404 into InvoicePlane:develop Jul 31, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

composer.json declares PHP ^8.3 but tooling/CI require PHP 8.4

2 participants