fleshgrinder/stringable 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

fleshgrinder/stringable

最新稳定版本:v0.1.0

Composer 安装命令:

composer require fleshgrinder/stringable

包简介

Interface for easy identification of classes that implement the magic __toString method.

README 文档

README

Packagist Packagist License

Stringable

Interface for easy identification of classes that implement PHP’s magic __toString method.

Provided is the interface itself that establishes the contract that implementing classes have to have the magic method. As well as a dummy class that can be used in tests as a substitute for doubles, stubs, or mocks.

Installation

Open a terminal, enter your project directory and execute the following command to add this package to your dependencies:

$ composer require fleshgrinder/stringable

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Usage

IMPORTANT
You cannot throw any exceptions in a __toSring method due to Zend engine limitations. Please vote and comment on the this PHP request and lets hope this will be fixed.

Simply implement the interface and PHP’s magic __toString method.

class YourClass implements Stringable {

    /**
     * @inheritDoc
     */
    public function __toString() {
        return '';
    }

}

License

MIT License

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固