Repository navigation
Conversation
Several 5.0 changes need an entry in the update guide; adding the page first keeps those pull requests from conflicting over creating it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AbstractWebApplication, WebApplicationInterface and the session aware interface and trait only documented their parameter, return and property types. They are now declared natively. redirect() answered Internet Explorer with a JavaScript redirect page for non-ASCII URLs. Internet Explorer is out of support since 2022, so the redirect is now always sent as a Location header. 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
AbstractWebApplication,WebApplicationInterface,SessionAwareWebApplicationInterfaceandSessionAwareWebApplicationTraitonly documented their parameter, return and property types (redirect($url, $status = 303),setHeader(),checkToken(),getFormToken(),allowCache(), …). This PR declares them natively, e.g.redirect(string $url, int $status = 303): void,setHeader(string $name, string $value, bool $replace = false): static, and types the properties (public string $charSet,public ?\DateTime $modifiedDate,public WebClient $client,protected Input $input, …). The full list is in the update guide.It also removes the JavaScript redirect page that
redirect()sent to Internet Explorer (Trident) for non-ASCII URLs; IE is out of support since 2022, so the redirect is always aLocationheader now. The fallback for "headers already sent" stays.Decisions taken here, for review:
redirect()returnsvoid, notneveras suggested: it ends withclose(), which applications and tests override so that it does not exit; aneverreturn type would turn those overrides into aTypeError.$charSet,$mimeType,$httpVersion,$modifiedDate,$client) are typed but stay public. Making them protected with accessors (also suggested) would break every application that sets$app->mimeType/$app->charSetdirectly, including the CMS, and needs a 4.x deprecation first — left for the maintainers to decide.Expires: Wed, 17 Aug 2005 00:00:00 GMTfor uncacheable responses is unchanged: any date in the past has the same effect, so changing it would only churn tests and docs.Testing Instructions
vendor/bin/phpunit,vendor/bin/phpstan analyse.testRedirectWithJavascriptRedirect(asserting the IE page) is replaced bytestRedirectWithNonAsciiUrlForInternetExplorer, which expects aLocationheader and no output.Documentation Changes Required
docs/v4-to-v5-update.md(native types incl. the strict_types caveat forsetHeader('Status', 404), typed properties, IE redirect removal) and the signatures indocs/api-reference.md.Depends on #169 (adds
docs/v4-to-v5-update.md; its commit is included here until it is merged). Related to #170 (both add to the same tables in the update guide, expect a small conflict there) and to the 4.x PRs #158 and #160–#166 (expect conflicts when 4.x-dev is merged into 5.x-dev indocs/api-reference.mdrows forredirect()/setHeader()and inredirect()(#160 moves the status check next to the removed IE branch), where the new signatures must be kept).🤖 Generated with Claude Code