laminas / laminas-http

Provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests
https://docs.laminas.dev/laminas-http/
BSD 3-Clause "New" or "Revised" License
36 stars 27 forks source link

Request object from controller is not usable by RequestInterface and PSR-7 #79

Closed Eugentis closed 1 year ago

Eugentis commented 1 year ago

Bug Report

Q A
Version(s) 2.18.0

Summary

Hi!

Class src/Request.php is not comfortable to use by Laminas\Stdlib\RequestInterface interface. Real object has more public methods in comparison with RequestInterface - for method, uri and others

Do you have any plans to use common PSR interfaces like RequestInterface?

It will be more comfortable to use in this situation.

Current behavior

In code you should use Request class as dependency instead of RequestInterface

How to reproduce

Try to use \Laminas\Mvc\Controller\AbstractController::getRequest() and receive uri by getUri() on it and check code by phpstan

Expected behavior

RequestInterface is suitable with PSR-7

laminas-bot commented 1 year ago

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee. If you have a security issue, please follow our security reporting guidelines. If you wish to take on the role of maintainer, please nominate yourself

You can continue using laminas/laminas-http safely. Its successor will be PSR-7 in a later revision of laminas/laminas-mvc.

Ocramius commented 1 year ago

Not for laminas/laminas-http: use a PSR-18 HTTP client implementation for that instead :)