承接 php-extended/polyfill-php80-stringable 相关项目开发

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

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

php-extended/polyfill-php80-stringable

最新稳定版本:1.2.12

Composer 安装命令:

composer require php-extended/polyfill-php80-stringable

包简介

A polyfill that adds the stringable interface added in php8.0 to previous versions of php

README 文档

README

A polyfill that adds the stringable interface added in php8.0 to previous versions of php.

coverage

Installation

The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.

  • Download composer.phar from their website.
  • Then run the following command to install this library as dependency :
  • php composer.phar install php-extended/polyfill-php80-stringable ^1

Motivation

There are a number of implementations of the \Stringable interface introduced by the rfc into php8.0, but none of them actually fit my needs. Those are:

  • strict standard implementation that follows the rfc proposal ;
  • transparent replacement for when the php version is upped to php8 withtout the need to redefine dependancy constraints for packages that depends on this one ;
  • backward compatibility up to php7.0

First, there is the symfony implementation. But by compatibility with php5, that implementation does not strictly follows the implementation described into the rfc (missing return type).

Then, there is the raigu implementation but that implementation allows exceptions to be thrown (which is a behavior that is allowed by php7.4 and php8). I need to have this interface available for lower versions of php7 and given the restriction on package versions, that implementation is unavailable.

Then, there is the fleshgrinder implementation. That implementation does not follow the rfc and is in its own namespace, which do not permit for transparent replacement when the php version of any program is upped to the php8 version.

There may be others implementations available that are not listed there.

License

MIT (See license file).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-19