Repository navigation
feat: Add support for PHP 8.4 and 8.5 #530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |
| } | ||
| ], | ||
| "require": { | ||
| "php": ">=8.1 <8.4", | ||
| "php": ">=8.1 <8.6", | ||
| "ext-curl": "*", | ||
| "ext-json": "*" | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,7 +110,22 @@ public function getErrorCode() | |
| public function getFileContents($filename, $use_include_path, $context) | ||
| { | ||
| $result = file_get_contents($filename, $use_include_path, $context); | ||
| $this->responseHeaders = $http_response_header; | ||
|
|
||
| // PHP 8.5 deprecated the locally scoped `$http_response_header` | ||
| // variable in favour of `http_get_last_response_headers()`. That | ||
| // function does not exist before 8.5, so both paths are kept. | ||
| // | ||
| // The legacy read uses `??` deliberately: a direct read raises the | ||
| // deprecation at compile time on 8.5, even inside `isset()`, while | ||
| // a null coalesced read does not. | ||
| $hasHeaderFunction = \function_exists( | ||
| 'http_get_last_response_headers' | ||
| ); | ||
|
|
||
| $this->responseHeaders = $hasHeaderFunction | ||
| ? (http_get_last_response_headers() ?? []) | ||
| : ($http_response_header ?? []); | ||
|
Comment on lines
+125
to
+127
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Prevent stale headers on non-HTTP reads. If an HTTP request precedes 🧰 Tools🪛 PHPStan (2.2.16)[error] 127-127: Variable $http_response_header on left side of ?? always exists and is not nullable. (nullCoalesce.variable) 🤖 Prompt for AI Agents |
||
|
|
||
| return $result; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: parse-community/parse-php-sdk
Length of output: 3406
🏁 Script executed:
Repository: parse-community/parse-php-sdk
Length of output: 3421
🏁 Script executed:
Repository: parse-community/parse-php-sdk
Length of output: 3464
Set least-privilege permissions for the
buildjob.The
buildjob runs checked-out repository and dependency code through Composer, npm, and test commands. Without explicit permissions, itsGITHUB_TOKENuses repository or organization defaults. A write-enabled default can expose write access to that code. Grant onlycontents: readunless a step requires more.Proposed fix
🧰 Tools
🪛 zizmor (1.30.1)
[warning] 2-70: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
[warning] 24-66: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents
Source: Linters/SAST tools