Repository navigation
Fix PHP 8.5 deprecations in router, auth, HTML, resizer and validation - #277
Conversation
substr(null) is deprecated on PHP 8.5. A null URL already normalized to '/', which casting to string keeps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk:
|
- Resizer::resize(): imagedestroy() is deprecated in PHP 8.5 and has been a no-op since PHP 8.0 (GdImage objects are freed automatically), so the call is removed. - HtmlBuilder::limit(): ord() on a string longer than one byte is deprecated in PHP 8.5. The matched tag (e.g. "<p>" or a multi-byte UTF-8 sequence) is now checked by its first byte, which is what ord() already used. - User::setPermissionsAttribute(): json_decode(null) when permissions are set to null, which already resulted in an empty permission set. - Router::url(): strlen(null) when a URL parameter is passed as null, which already counted as not supplied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m tests setAccessible() has had no effect since PHP 8.1 (the minimum supported version) and is deprecated in PHP 8.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Backend forms register every field's label as its validation attribute name, and a field without a label registers null. Lang::get(null) then raises several PHP 8.5 deprecations inside Laravel's translator (null array offsets, str_contains/explode on null) every time such a form is validated. Lang::get(null) returned null, so a null name now stays null without the lookup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes PHP 8.5 deprecations found on a production site running PHP 8.5, then by running Storm's and Winter's test suites on PHP 8.5 with every deprecation logged at its call site (922 Storm tests pass). Behaviour is unchanged in each case.
Router\Helper::normalizeUrl():substr(null)for a null URL (already normalized to/)Router::urlFromPattern():strlen(null)when a URL parameter is null, e.g.|page({slug: null})Auth\Models\User:json_decode(null)when permissions are null (the most frequent hit in Winter's test run, 460 times)HtmlBuilder::limit():ord()on a multi-byte string is deprecated;ord($tag[0])reads the same first byteResizer: removedimagedestroy()(deprecated in 8.5, a no-op since 8.0); fired on every resizeValidationtrait: fields without a label register a null attribute name, andLang::get(null)raised several deprecations in Laravel's translator; a null name now stays null without the lookup (Lang::get(null)returned null anyway)setAccessible()calls (deprecated in 8.5, a no-op since 8.1)Not fixed here: implicit float to int conversions passed to
imagescale()/imagecreatetruecolor()inResizer(a PHP 8.1 deprecation that needs a rounding decision), and the soft-deprecated__wakeup()in the Singleton classes, which exists to block unserializing singletons.Overlaps nothing in #229/#232.
🤖 Generated with Claude Code