Version 2.0 of the library does indeed include type hints here: https://github.com/php-fig/http-message/blob/master/src/ServerRequestInterface.php#L197
And voted on in 2023 here: https://groups.google.com/g/php-fig/c/O9YaSCH3jI4/m/F_GN8e-aBAAJ?utm_medium=email&utm_source=footer&pli=1 The reason it wasn't originally type hinted was because PSR-7 was approved 4 full years before return types were available in PHP. Best, Korvin On Tue, Aug 12, 2025 at 3:27 AM Emad Al-mahdi <emad.st...@gmail.com> wrote: > Hello, > > I wonder why the method [withParsedBody] is not type hinted in the > interface [ServerRequestInterface]. Se below: > > /** > * Return an instance with the specified body parameters. > * > * These MAY be injected during instantiation. > * > * If the request Content-Type is either > application/x-www-form-urlencoded > * or multipart/form-data, and the request method is POST, use this > method > * ONLY to inject the contents of $_POST. > * > * The data IS NOT REQUIRED to come from $_POST, but MUST be the > results of > * deserializing the request body content. Deserialization/parsing > returns > * structured data, and, as such, this method ONLY accepts arrays or > objects, > * or a null value if nothing was available to parse. > * > * As an example, if content negotiation determines that the request > data > * is a JSON payload, this method could be used to create a request > * instance with the deserialized parameters. > * > * This method MUST be implemented in such a way as to retain the > * immutability of the message, and MUST return an instance that has > the > * updated body parameters. > * > * @param null|array|object $data The deserialized body data. This > will > * typically be in an array or object. > * @return static > * @throws \InvalidArgumentException if an unsupported argument type > is > * provided. > */ > public function withParsedBody($data): ServerRequestInterface; > > -- > You received this message because you are subscribed to the Google Groups > "PHP Framework Interoperability Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to php-fig+unsubscr...@googlegroups.com. > To view this discussion visit > https://groups.google.com/d/msgid/php-fig/2ea4698d-4813-4a57-8aba-81e1dce579d0n%40googlegroups.com > <https://groups.google.com/d/msgid/php-fig/2ea4698d-4813-4a57-8aba-81e1dce579d0n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/php-fig/CANeXGWUMUqVGYQcjGnxbqTkBac0y%2B2iDRtxvWsA133SYQ4t26Q%40mail.gmail.com.