Skip to content

Conversation

@KpuTuK
Copy link

@KpuTuK KpuTuK commented Nov 1, 2015

Example:

<?php
class Request extends ServerRequest implements
    RequestInterface, RequestMethodInterface 
{
    public function __construct(
        $uri = '/',
        $method = Request::METHOD_GET,
        array $server = array(), 
        array $query = array(), 
        array $parsedBody = array(), 
        array $cookies = array(), 
        array $files = array()
    ) {
        //...
    }
}

$request = new Http\Request(
            '/', 
            Request::METHOD_GET,
            $GLOBALS['_SERVER'], 
            $GLOBALS['_GET'],
            $GLOBALS['_POST'],
            $GLOBALS['_COOKIE'], 
            $GLOBALS['_FILES']
        );

Example:

<?php
class Request extends ServerRequest implements
    RequestInterface, RequestMethodInterface 
{
    public function __construct(
        $uri = '/',
        RequestMethodInterface $method = Request::METHOD_GET,
        array $server = array(), 
        array $query = array(), 
        array $parsedBody = array(), 
        array $cookies = array(), 
        array $files = array()
    ) {
        //...
    }
}

$request = new Http\Request(
            '/', 
            Request::METHOD_GET,
            $GLOBALS['_SERVER'], 
            $GLOBALS['_GET'],
            $GLOBALS['_POST'],
            $GLOBALS['_COOKIE'], 
            $GLOBALS['_FILES']
        );
@weierophinney
Copy link
Contributor

I like this idea a lot, but am asking @php-fig/secretaries and other PSR authors if we can include convenience code not defined in the PSR but within the same scope. It looks like we'd likely need to create a util repo, such as was done with php-fig/cache-util. If we do that, I'll ping you to make this PR against that one instead.

@michaelcullum
Copy link
Member

As per IRC, I'm for having a utils repo. @weierophinney If you're 👍 on that then shall we proceed?

@weierophinney
Copy link
Contributor

weierophinney commented Aug 4, 2016

@KpuTuK We've now created a new repository, http-message-util. Could you submit this pull request against that repository, please?

@weierophinney
Copy link
Contributor

I was able to pull this in as a patch to http-message-util, keeping attribution. Thanks, @KpuTuK !

@KpuTuK
Copy link
Author

KpuTuK commented Aug 21, 2016

Thank!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants