Fix PHP warnings: E_STRICT deprecation and "Array" in the ticket timeline (#130) #133

Merged
jared merged 1 commits from php-warnings-130 into development 2026-11-28 23:37:44 -05:00
Owner

Closes #130. Fixes the two PHP warnings in prod's error log.

1. Constant E_STRICT is deprecated (helpers/ErrorHandler.php)

  • Dropped E_STRICT => 'STRICT' from the error-type name map. PHP 8.4 deprecates the constant, and a later PHP removes it.
  • It has had no effect since PHP 8.0, so no error ever carries that type, and nothing is lost on 8.2/8.3 either.
  • Nothing else in the code uses E_STRICT.

2. Array to string conversion and the literal "Array" in the ticket timeline (views/TicketView.php)

  • Cause: the timeline showed an audit detail as "from → to" only when isset($v['from'], $v['to']), which is false when either side is null.
  • Who hit it: the source and dedup_key backfills from #123 log {from: null, to: ...}. So 147 tickets showed "Array", and the server logged a warning on every view.
  • Same bug in the header: the timeline header said "updated this ticket" instead of "updated source".
  • Fix:
    • isAuditDelta() uses array_key_exists.
    • formatAuditValue() shows null/empty as "(none)", booleans as yes/no and any array as JSON, so no shape can print "Array" again. Long values are still cut at 60 characters. Other details are cut at 500; before, they had no limit.
    • The header and the detail lines use the same check.

Screenshots

Synthetic ticket on a local stack with three audit rows: a source backfill (from: null), a dedup_key backfill, and a priority change with a nested and a boolean extra. The page and the console showed no errors.

Before (development) After (this branch)
before after

Verification

  • Local timeline: before, the dev server logged 3 × Array to string conversion in views/TicketView.php on line 812, the same line as prod. After: 0.
  • E_STRICT: only PHP 8.2 is available locally, so that deprecation can't be reproduced here. After deploy, grep -c "E_STRICT\|Array to string" /var/log/nginx/error.log on CT132 should stop growing.
  • phpcs (.phpcs.xml) is clean.

🤖 Generated with Claude Code

Closes #130. Fixes the two PHP warnings in prod's error log. ## 1. `Constant E_STRICT is deprecated` (`helpers/ErrorHandler.php`) - Dropped `E_STRICT => 'STRICT'` from the error-type name map. PHP 8.4 deprecates the constant, and a later PHP removes it. - It has had no effect since PHP 8.0, so no error ever carries that type, and nothing is lost on 8.2/8.3 either. - Nothing else in the code uses `E_STRICT`. ## 2. `Array to string conversion` and the literal "Array" in the ticket timeline (`views/TicketView.php`) - **Cause:** the timeline showed an audit detail as "from → to" only when `isset($v['from'], $v['to'])`, which is false when either side is `null`. - **Who hit it:** the source and `dedup_key` backfills from #123 log `{from: null, to: ...}`. So **147 tickets** showed "Array", and the server logged a warning on every view. - **Same bug in the header:** the timeline header said "updated this ticket" instead of "updated source". - **Fix:** - `isAuditDelta()` uses `array_key_exists`. - `formatAuditValue()` shows `null`/empty as "(none)", booleans as yes/no and any array as JSON, so no shape can print "Array" again. Long values are still cut at 60 characters. Other details are cut at 500; before, they had no limit. - The header and the detail lines use the same check. ## Screenshots Synthetic ticket on a local stack with three audit rows: a `source` backfill (`from: null`), a `dedup_key` backfill, and a priority change with a nested and a boolean extra. The page and the console showed no errors. | Before (`development`) | After (this branch) | |---|---| | ![before](https://code.lotusguild.org/LotusGuild/tinker_tickets/raw/branch/pr-133-screenshots/timeline-before.png) | ![after](https://code.lotusguild.org/LotusGuild/tinker_tickets/raw/branch/pr-133-screenshots/timeline-after.png) | ## Verification - **Local timeline:** before, the dev server logged 3 × `Array to string conversion in views/TicketView.php on line 812`, the same line as prod. After: 0. - **`E_STRICT`:** only PHP 8.2 is available locally, so that deprecation can't be reproduced here. After deploy, `grep -c "E_STRICT\|Array to string" /var/log/nginx/error.log` on CT132 should stop growing. - phpcs (`.phpcs.xml`) is clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jared added 1 commit 2026-11-28 23:30:06 -05:00
Fix PHP warnings: E_STRICT deprecation and "Array" in the ticket timeline (#130)
Lint / JS (eslint) (push) Successful in 13s
Lint / PHP (phpcs PSR-12) (push) Successful in 34s
Lint / PHP requirements (version + extensions) (push) Successful in 37s
Lint / Deploy (push) Skipped
Lint / Notify on failure (push) Skipped
Lint / PHP (phpcs PSR-12) (pull_request) Successful in 37s
Lint / JS (eslint) (pull_request) Successful in 12s
Security / PHP Security (semgrep) (push) Successful in 1m51s
Lint / PHP requirements (version + extensions) (pull_request) Successful in 35s
Lint / Deploy (pull_request) Skipped
Lint / Notify on failure (pull_request) Skipped
Security / PHP Security (semgrep) (pull_request) Successful in 1m49s
73390b1edd
ErrorHandler: drop E_STRICT from the error-type name map. PHP 8.4
deprecates the constant (it has had no effect since 8.0, so no error ever
carried that type), and a later PHP removes it.

TicketView timeline: audit details were shown as "from -> to" only when
isset($v['from'], $v['to']), which is false when either side is null.
The source and dedup_key backfills (#123) log {from: null, to: ...}, so
147 tickets showed the literal "Array" and logged "Array to string
conversion" on every view. isAuditDelta() uses array_key_exists, and
formatAuditValue() shows null as "(none)", booleans as yes/no and any
array as JSON, so no shape can print "Array" again. The timeline header
("updated source") uses the same check.

Closes #130

Co-Authored-By: Claude Opus 5.5 <[email protected]>
jared referenced this issue from a commit 2026-11-28 23:30:13 -05:00
jared merged commit 9e3b5406e2 into development 2026-11-28 23:37:44 -05:00
jared deleted branch php-warnings-130 2026-11-28 23:37:45 -05:00
Sign in to join this conversation.