Location
src/Http/Request.php:9-27
Problem
The class exposes withHeader() as a deprecated alias of setHeader(). In PSR-7 the withX prefix is reserved for methods that return a new instance with the change applied; the bundle's withHeader() actually mutates and returns $this. The naming sets up the wrong expectation for any developer used to PSR-7.
What to change
- Remove the deprecated
withHeader() alias once a migration path is announced, or rename it to a non-PSR-7 verb (addHeader, setHeader) and keep the alias only for backwards compatibility behind a deprecation notice that mentions the semantic mismatch.
- Update the class-level PHPDoc to call out that this request is not PSR-7-compatible.
Acceptance criteria
Location
src/Http/Request.php:9-27Problem
The class exposes
withHeader()as a deprecated alias ofsetHeader(). In PSR-7 thewithXprefix is reserved for methods that return a new instance with the change applied; the bundle'swithHeader()actually mutates and returns$this. The naming sets up the wrong expectation for any developer used to PSR-7.What to change
withHeader()alias once a migration path is announced, or rename it to a non-PSR-7 verb (addHeader,setHeader) and keep the alias only for backwards compatibility behind a deprecation notice that mentions the semantic mismatch.Acceptance criteria
withHeader()alias is removed, or its PHPDoc explicitly warns that it mutates and is not PSR-7-compliant.vendor/bin/phpunit).