fix(psalm): the findings Psalm 7 reports under PHP 8.5 #6

Merged
dawid merged 1 commit from fix/psalm-7-findings into main 2026-11-10 17:55:53 +00:00
Owner

main's standards job fails since #4 (Psalm 7): Renovate re-created #4's branch before it was merged and dropped the baseline update, and Psalm 7 on the CI image's PHP 8.5 reports 5 findings at new places and 7 baseline entries as unused.

This fixes the five instead of baselining them (CliProcess's closed pipes, a redundant is_array in Schema, a float cast in Numerics) and suppresses TaintedShell for CliProcess, whose proc_open gets an argv array and so no shell. --update-baseline then dropped the unused entries and added none.

Checked in composer:2 (PHP 8.5.12, Psalm 7.0.5, as CI): Psalm 0 errors, php-cs-fixer clean, PHPUnit 249 tests OK.

main's `standards` job fails since #4 (Psalm 7): Renovate re-created #4's branch before it was merged and dropped the baseline update, and Psalm 7 on the CI image's PHP 8.5 reports 5 findings at new places and 7 baseline entries as unused. This fixes the five instead of baselining them (CliProcess's closed pipes, a redundant is_array in Schema, a float cast in Numerics) and suppresses TaintedShell for CliProcess, whose proc_open gets an argv array and so no shell. `--update-baseline` then dropped the unused entries and added none. Checked in `composer:2` (PHP 8.5.12, Psalm 7.0.5, as CI): Psalm 0 errors, php-cs-fixer clean, PHPUnit 249 tests OK.
fix(psalm): the findings Psalm 7 reports under PHP 8.5
All checks were successful
CI / php (dev-master) (pull_request) Successful in 39s
CI / php (dev-stable32) (pull_request) Successful in 27s
CI / php (dev-stable34) (pull_request) Successful in 26s
CI / php (dev-stable33) (pull_request) Successful in 39s
CI / php (dev-stable35) (pull_request) Successful in 25s
CI / markdown (pull_request) Successful in 10s
CI / standards (pull_request) Successful in 55s
CI / talk-api (pull_request) Successful in 41s
CI / server (32) (pull_request) Successful in 1m25s
CI / server (35) (pull_request) Successful in 1m24s
CI / golden (pull_request) Successful in 3m7s
f926628e1c
Psalm 7 on the CI image's PHP 8.5 reports what the baseline kept under the
old runtime at other places, so main's standards job failed:

- CliProcess takes a pipe out of $pipes before closing it, so the property
  never holds a closed resource.
- Schema::check returns early for a value that is not an array instead of
  testing is_array twice.
- Numerics casts array_sum's result to float, as the matrix holds floats.
- TaintedShell is suppressed for CliProcess: proc_open gets an argv array,
  which PHP runs without a shell.

The baseline loses the entries these fixes made unused; it gains none.
dawid merged commit 87e0c76b81 into main 2026-11-10 17:55:53 +00:00
dawid deleted branch fix/psalm-7-findings 2026-11-10 17:55:53 +00:00
Sign in to join this conversation.
No description provided.