定制 phariscope/safephp 二次开发

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

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

phariscope/safephp

最新稳定版本:1.0.3

Composer 安装命令:

composer require phariscope/safephp

包简介

A PHP library complementary to SafePHP containing currently unsupported functions.

README 文档

README

A set of core PHP functions rewritten to throw exceptions instead of returning false when an error is encountered.

These functions complement those of the excellent SafePHP tool https://github.com/thecodingmachine/safe.

Installation

composer require phariscope/safephp

Usage

use function SafePHP\boolval; use function SafePHP\floatval; use function SafePHP\intval; use function SafePHP\strval; use function SafePHP\hash_file; use function SafePHP\getenv; use function SafePHP\getenvOrWithENV; $value = boolval(1); // return true $value = floatval("123.456"); // return 123.456 $value = intval("123"); // return 123 $value = strval(1); // return "1" $value = hash_file("md2", $filename); // return a string like "080bf15137e26254e9cd8870b68aec86" $value = getenv('PWD'); // return string of current PWD $value = getenv(); // return array of all getenv (be carreful some $_ENV may hav been forgotten)  $value = getenvOrWithENV('PWD'); // return string of current PWD even if it is in $_ENV only

To Contribute to phariscope/SafePHP

Requirements

  • docker
  • git

Install

Unit test

bin/phpunit

Using Test-Driven Development (TDD) principles (thanks to Kent Beck and others), following good practices (thanks to Uncle Bob and others).

Quality

  • phpcs PSR12
  • phpstan level 9
  • coverage 100%
  • infection MSI >99%

Quick check with:

./codecheck

Check coverage with:

bin/phpunit --coverage-html var

and view 'var/index.html' with your browser

Check infection with:

bin/infection

and view 'var/infection.html' with your browser

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固