Repository navigation
Conversation
Several 5.x changes add entries to docs/v4-to-v5-update.md; creating the file once keeps them from conflicting over its creation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package requires PHP 8.3 but still declared its API in docblocks, and count() carried #[\ReturnTypeWillChange]. Parameters, return values and properties are now typed natively. set() keeps an untyped return value because Cookie::set() returns whether the cookie was sent, and the $filter argument of get() stays untyped until getArray() no longer passes input values as filter names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
The package requires PHP
^8.3but its API is typed only in docblocks, andInput::count()still carries#[\ReturnTypeWillChange]. This adds native parameter, return and property types toInput,Cookie,FilesandJson(count(): int,exists(string $name): bool,get(string $name, mixed $default = null, $filter = 'cmd'): mixed, typed$options/$data/$inputs/$filterproperties,?array $sourcein the constructors, …). The full list is in the update guide.Deliberately left untyped:
set():Cookie::set()is to return whether the cookie was sent, which avoidonInput::set()would forbid. The 5.0 cookie change (Cookie::set(): bool) builds on this;$filterofget(): on5.x-dev,getArray()without arguments still passes input values (includingnull) as filter names; [4.x] Do not use input values as filter names in getArray() #56 fixes that on 4.x. After 4.x-dev is merged up,$filtercan becomestring;Json::getRaw(): its no-argument variant is deprecated in [4.x] Make Json::getRaw() return an unfiltered value and add getRawBody() #60 and removed by a separate 5.x PR.Depends on #65 (adds
docs/v4-to-v5-update.md); this branch contains its commit until it is merged.When 4.x-dev is merged up: the 4.x PRs add methods that must then get matching types, or PHP rejects the class:
Input::__isset()from #63 (__isset(string $name): bool), andJson::getRawBody()/getRaw()from #60.Testing Instructions
The existing test suite passes unchanged; PHPStan and PHPCS report no errors.
Documentation Changes Required
docs/v4-to-v5-update.md: new section listing the typed signatures and what subclasses and callers need to check.Depends on #65
🤖 Generated with Claude Code