Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,14 @@ jobs:
composer:
- 2
php:
- 7.2
- 7.4
- 7.3
- 8.0
- 8.1
- 8.2
- 8.3
- 8.4
name: Test - php:${{ matrix.php }}; composer:${{ matrix.composer }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@master
uses: shivammathur/setup-php@2.34.1
with:
php-version: ${{ matrix.php }}
extensions: curl, gd, pdo_mysql, json, mbstring, pcre, session
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"require": {
"imponeer/log-data-output-decorator": "^1.0",
"php": ">=7.1",
"php": ">=8.3",
"imponeer/extension-info-contracts": "^0.1.0 || ^0.3"
},
Comment on lines 5 to 9
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Guard against unknown PHP 9.x with a stricter constraint

"php": ">=8.3" will also allow Composer to install the library on PHP 9.x+ as soon as it is released.
Unless you have already tested your codebase against the next major version, prefer an upper bound (or a caret range) to avoid accidental BC breaks pulled in by users:

-        "php": ">=8.3",
+        "php": "^8.3",               # equivalent to >=8.3 <9.0

(or ">=8.3 <9.0" if you want the explicit form).


🏁 Script executed:

#!/bin/bash
set -e

echo "Locating composer.json..."
composer_file=$(find . -maxdepth 2 -type f -name composer.json | head -n1)
echo "Found: $composer_file"

echo -e "\nShowing PHP requirement in composer.json:"
grep -n '"php":' "$composer_file" || true

echo -e "\nChecking CI workflows for PHP 9.x support..."
if [ -d .github/workflows ]; then
  grep -R -n "php" .github/workflows || echo "No PHP versions found in workflows."
else
  echo ".github/workflows directory not found."
fi

Length of output: 981


🏁 Script executed:

#!/bin/bash
set -e

echo "Extracting PHP versions from on_pull_request.yml..."
grep -R -n "matrix.php" -A3 .github/workflows/on_pull_request.yml

Length of output: 534


🏁 Script executed:

#!/bin/bash
set -e

echo "Extracting PHP versions from matrix in on_pull_request.yml..."
grep -R -n "matrix:" -A5 .github/workflows/on_pull_request.yml

Length of output: 313


Restrict PHP requirement to <9.0

To prevent accidental installs on untested PHP 9.x versions, please tighten the constraint in your composer.json:

• File: composer.json

 "require": {
-    "php": ">=8.3",
+    "php": "^8.3",        # equivalent to >=8.3 <9.0
 }

You’ll still cover PHP 8.3 and 8.4 (as in your CI matrix) while guarding against unexpected breakage on PHP 9.x.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"require": {
"imponeer/log-data-output-decorator": "^1.0",
"php": ">=7.1",
"php": ">=8.3",
"imponeer/extension-info-contracts": "^0.1.0 || ^0.3"
},
"require": {
"imponeer/log-data-output-decorator": "^1.0",
- "php": ">=8.3",
+ "php": "^8.3",
"imponeer/extension-info-contracts": "^0.1.0 || ^0.3"
},
🤖 Prompt for AI Agents
In composer.json around lines 5 to 9, the PHP version requirement is set to
">=8.3" which allows installation on PHP 9.x versions that are untested. Update
the PHP version constraint to ">=8.3 <9.0" to restrict installations to PHP
versions 8.3 and 8.4 only, preventing accidental installs on PHP 9.x.

"license": "MIT",
Expand Down