Skip to content

Incorrect implementation of \Shieldon\Psr17\RequestFactory::createRequest #1

@kiklop74

Description

@kiklop74

This is the official interface declaration from psr/http-factory

namespace Psr\Http\Message;

interface RequestFactoryInterface
{
    /**
     * Create a new request.
     *
     * @param string $method The HTTP method associated with the request.
     * @param UriInterface|string $uri The URI associated with the request. If
     *     the value is a string, the factory MUST create a UriInterface
     *     instance based on it.
     *
     * @return RequestInterface
     */
    public function createRequest(string $method, $uri): RequestInterface;
}

As you can is in the comment for $uri parameter it can be either string or UriInterface. Your implementation assumes string only. I think it should be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions