Skip to content

refactor: remove deprecations in HTTP#10000

Open
paulbalandan wants to merge 1 commit intocodeigniter4:4.8from
paulbalandan:cleanup-http
Open

refactor: remove deprecations in HTTP#10000
paulbalandan wants to merge 1 commit intocodeigniter4:4.8from
paulbalandan:cleanup-http

Conversation

@paulbalandan
Copy link
Copy Markdown
Member

@paulbalandan paulbalandan commented Feb 24, 2026

Description
Sending this early to get the #10000 slot. 😂

This is not yet complete, but initially there are quite breaking changes:

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan paulbalandan added refactor Pull requests that refactor code breaking change Pull requests that may break existing functionalities docs needed Pull requests needing documentation write-ups and/or revisions. 4.8 PRs that target the `4.8` branch. labels Feb 24, 2026
@paulbalandan paulbalandan marked this pull request as draft February 24, 2026 15:50
@michalsn
Copy link
Copy Markdown
Member

Sending this early to get the #10000 slot. 😂

Haha, love the dedication 😆

I'm a little concerned about removing URI::setSilent(). Given how commonly it's used, this might be more disruptive than expected.

@paulbalandan
Copy link
Copy Markdown
Member Author

I'm a little concerned about removing URI::setSilent(). Given how commonly it's used, this might be more disruptive than expected.

The deprecation was made in #7252 , mainly because it's not in PSR-7. Do you mean to "un-deprecate" it?

@michalsn
Copy link
Copy Markdown
Member

Well, the reason in the comment ("Method not in PSR-7") isn't very fortunate, because PSR-7 allows extra methods.

The real problem is immutability and hidden behavioral state.

Since setSilent() has existed for a long time and occasionally comes up on Slack, I would prefer postponing removal until v5 to avoid unnecessary complaints.

@paulbalandan
Copy link
Copy Markdown
Member Author

Okay, I'll retain it and add a hard deprecation notice on it. For the *Silent tests, are you fine with removing them though?

@michalsn
Copy link
Copy Markdown
Member

Yes, thank you!

@github-actions github-actions bot added the stale Pull requests with conflicts label Feb 27, 2026
@github-actions

This comment was marked as resolved.

@paulbalandan paulbalandan removed stale Pull requests with conflicts docs needed Pull requests needing documentation write-ups and/or revisions. labels Mar 28, 2026
@paulbalandan paulbalandan changed the title refactor: remove deprecations in HTTP [WIP] refactor: remove deprecations in HTTP Mar 28, 2026
@paulbalandan paulbalandan marked this pull request as ready for review March 28, 2026 20:00
{
if (array_key_exists('baseURI', $options)) {
$this->baseURI = $this->baseURI->setURI($options['baseURI']);
$this->baseURI = new URI($options['baseURI']);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also problematic. In the constructor, we call $uri->useRawQueryString(), which prevents the use of parse_str(). This is important because parse_str() would modify query parameters - for example, converting http://example.com/?foo.bar=baz into foo_bar=baz.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, since useRawQueryString() is not in PSR 7, how about putting that as the 2nd argument in URI's constructor, call here with true, then deprecate useRawQueryString()?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with adding this to the constructor. Deprecating useRawQueryString() would also make sense, as the parsing behavior would be fixed at construction time. Although I'm not sure if this would be a problem in the long run, probably no one is using this feature elsewhere.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured in the docs, it can be called before using setQueryArray(), so making it constructor-only seems an unnecessary break. Instead, I just called useRawQueryString() immediately after instantiation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work if the baseURI has a query. This is too late, as the constructor has already run through setQuery().

@github-actions

This comment was marked as resolved.

@github-actions github-actions bot added the stale Pull requests with conflicts label Mar 29, 2026
@paulbalandan paulbalandan removed the stale Pull requests with conflicts label Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.8 PRs that target the `4.8` branch. breaking change Pull requests that may break existing functionalities refactor Pull requests that refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants