承接 alxmsl/psr-7 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alxmsl/psr-7

Composer 安装命令:

composer require alxmsl/psr-7

包简介

PSR-7 interfaces with strict types declarations

README 文档

README

License Latest Stable Version Total Downloads

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.

For example, if Psr\Http\RequestInterface is defined like

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

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

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

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.

统计信息

  • 总下载量: 27
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2016-01-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固