Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Cannot use Zend\Stdlib\ResponseInterface as Response because the name is already in use in Zend\Stdlib\DispatchableInterface #5223

Closed
harpcio opened this Issue · 2 comments

3 participants

@harpcio

I found this bug when I was testing my Controller with PHPUnit. Controller use service and the service return SuccessResponse which extends Zend\Stdlib\Response.

Solution:

namespace Zend\Stdlib;

use Zend\Stdlib\RequestInterface;
use Zend\Stdlib\ResponseInterface;

interface DispatchableInterface
{
    /**
     * Dispatch a request
     *
     * @param RequestInterface       $request
     * @param null|ResponseInterface $response
     *
     * @return Response|mixed
     */
    public function dispatch(RequestInterface $request, ResponseInterface $response = null);
}
@Maks3w
Collaborator

Indeed. Could you send a Pull Request with your patch?

PD: There is no need of import that interfaces (uses) since all interfaces are in the same namespace

@ClemensSahs ClemensSahs referenced this issue from a commit in ClemensSahs/zf2
@ClemensSahs ClemensSahs fix for #5223
Problem with namespace
fa61a25
@weierophinney

It appears @mwillbanks Merged this on the 19th; closing.

@Maks3w Maks3w referenced this issue
Merged

Fixes for #5356 #5408

@gianarb gianarb referenced this issue from a commit in zendframework/zend-stdlib
@ClemensSahs ClemensSahs fix for zendframework/zf2#5223
Problem with namespace
4bfd62c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.