定制 kaspi/http-message 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

kaspi/http-message

最新稳定版本:1.3.1

Composer 安装命令:

composer require kaspi/http-message

包简介

HTTP Message implementation PSR-7, PSR-17

README 文档

README

Kaspi/http-message is a lightweight implementation PSR-7, PSR-17 for >= PHP 8.1

Implementation of PSR-17:

  • \Kaspi\HttpMessage\HttpFactory::class

Implementation of PSR-7:

  • \Kaspi\HttpMessage\Message::class
  • \Kaspi\HttpMessage\Request::class
  • \Kaspi\HttpMessage\Response::class
  • \Kaspi\HttpMessage\ServerRequest::class
  • \Kaspi\HttpMessage\Stream::class
  • \Kaspi\HttpMessage\UploadedFile::class
  • \Kaspi\HttpMessage\Uri::class

Additional implementations for \Psr\Http\Message\StreamInterface

  • \Kaspi\HttpMessage\Stream\FileStream::class
  • \Kaspi\HttpMessage\Stream\PhpMemoryStream::class
  • \Kaspi\HttpMessage\Stream\PhpTempStream::class

Installation

composer require kaspi/http-message

Local development

Required PHP 8.1 or higher, php Composer

Testing

Run test without code coverage

composer test

Running tests with checking code coverage by tests with a report in html format

./vendor/bin/phpunit

Requires installed PCOV driver

⛑ the results will be in the folder .coverage-html

Static code analysis

For static analysis we use the package Phan.

Running without PHP extension PHP AST

./vendor/bin/phan --allow-polyfill-parser

Code style

To bring the code to standards, we use php-cs-fixer which is declared in composer's dev dependencies

composer fixer

Using Docker image with PHP 8.1, 8.2, 8.3, 8.4, 8.5

You can specify the image with the PHP version in the .env file in the PHP_IMAGE key. By default, the container is built with the php:8.1-cli-alpine image.

Build docker container

docker-compose build

Install php composer dependencies:

docker-compose run --rm php composer install

Run tests with a code coverage report and a report in html format

docker-compose run --rm php vendor/bin/phpunit --no-coverage

⛑ the results will be in the folder .coverage-html

Phan (static analyzer for PHP)

docker-compose run --rm php vendor/bin/phan

You can work in a shell in a docker container:

docker-compose run --rm php sh
Using Makefile commands.

Check and correct code style:

make fix

Run the static code analyzer:

make stat

Run tests:

make test

Run all stages of checks:

make all

Run tests for all support PHP versions:

make test-supports-php

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固