2017 © Pedro Peláez
 

library psr-7

PSR-7 interfaces with strict types declarations

image

alxmsl/psr-7

PSR-7 interfaces with strict types declarations

  • Saturday, January 9, 2016
  • by alxmsl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PSR-7 interfaces

License Latest Stable Version Total Downloads, (*1)

This repository holds all interfaces related to PSR-7. This's fork of php-fig/http-message except usage of strict types. All interface methods have strict type declarations., (*2)

For example, if Psr\Http\RequestInterface is defined like, (*3)

interface RequestInterface extends MessageInterface {
    /**
     * @return string
     */
    public function getRequestTarget();

    /**
     * @param mixed $requestTarget
     * @return self
     */
    public function withRequestTarget($requestTarget);

    /**
     * @return string Returns the request method.
     */
    public function getMethod();

    /**
     * @param string $method Case-sensitive method.
     * @return self
     * @throws InvalidArgumentException for invalid HTTP methods.
     */
    public function withMethod($method);

    /**
     * @return UriInterface Returns a UriInterface instance representing the URI of the request.
     */
    public function getUri();

    /**
     * @param UriInterface $uri New request URI to use.
     * @param bool $preserveHost Preserve the original state of the Host header.
     * @return self
     */
    public function withUri(UriInterface $uri, $preserveHost = false);
}

...then alxmsl\Psr7\RequestInterface will be defined like, (*4)

interface RequestInterface extends MessageInterface {
    /**
     * @return string
     */
    public function getRequestTarget(): string;

    /**
     * @param mixed $requestTarget
     * @return self
     */
    public function withRequestTarget(mixed $requestTarget): RequestInterface;

    /**
     * @return string Returns the request method.
     */
    public function getMethod(): string;

    /**
     * @param string $method Case-sensitive method.
     * @return self
     * @throws InvalidArgumentException for invalid HTTP methods.
     */
    public function withMethod(string $method): RequestInterface;

    /**
     * @return UriInterface Returns a UriInterface instance representing the URI of the request.
     */
    public function getUri(): UriInterface;

    /**
     * @param UriInterface $uri New request URI to use.
     * @param bool $preserveHost Preserve the original state of the Host header.
     * @return self
     */
    public function withUri(UriInterface $uri, bool $preserveHost = false): RequestInterface;
}

License

Copyright 2016 Alexey Maslov alexey.y.maslov@gmail.com, (*5)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at, (*6)

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License., (*7)

The Versions

09/01 2016

dev-master

9999999-dev

PSR-7 interfaces with strict types declarations

  Sources   Download

Apache-2.0

The Requires

  • php >=7.0

 

by Avatar alxmsl

psr psr-7 http request response http-message

09/01 2016

v0.1.1

0.1.1.0

PSR-7 interfaces with strict types declarations

  Sources   Download

Apache-2.0

The Requires

  • php >=7.0

 

by Avatar alxmsl

psr psr-7 http request response http-message