承接 tobento/service-support 相关项目开发

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

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

tobento/service-support

最新稳定版本:2.0.3

Composer 安装命令:

composer require tobento/service-support

包简介

Interfaces and classes for supporting applications.

README 文档

README

The Support Service provides interfaces and classes supporting applications.

Table of Contents

Getting started

Add the latest version of the support service running this command.

composer require tobento/service-support

Requirements

  • PHP 8.4 or greater

Documentation

Interfaces

Arrayable

use Tobento\Service\Support\Arrayable;

interface Arrayable
{
    /**
     * Get the object as an array.
     *
     * @return array
     */
    public function toArray(): array;    
}

Htmlable

use Tobento\Service\Support\Htmlable;

interface Htmlable
{
    /**
     * Get content as a string of HTML.
     *
     * @return string
     */
    public function toHtml(): string;
}

Jsonable

use Tobento\Service\Support\Jsonable;

interface Jsonable
{
    /**
     * Get the object as a JSON string.
     *
     * @param int $options
     * @return string
     */
    public function toJson(int $options = 0): string;    
}

Renderable

use Tobento\Service\Support\Renderable;

interface Renderable
{
    /**
     * Get the evaluated contents of the object.
     *
     * @return string
     */
    public function render(): string;    
}

Responsable

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Tobento\Service\Support\Responsable;

interface Responsable
{
    /**
     * Create a HTTP response that represents the object.
     *
     * @param ServerRequestInterface $request
     * @return ResponseInterface
     */
    public function toResponse(ServerRequestInterface $request): ResponseInterface;    
}

Html String

The HtmlString::class can be useful in certain situations where a string should not be escaped by another function.

use Tobento\Service\Support\HtmlString;

$htmlString = new HtmlString('<h1>foo</h1>');

// you may check if the string is empty or not:
var_dump($htmlString->isEmpty());
// bool(false)

Credits

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固