czproject/assert
最新稳定版本:v2.0.1
Composer 安装命令:
composer require czproject/assert
包简介
Assert helper.
README 文档
README
Assert helper, throws exceptions.
Installation
Download a latest package or use Composer:
composer require czproject/assert
CzProject\Assert requires PHP 8.0 or later.
Usage
use CzProject\Assert\Assert; function add($a, $b) { Assert::int($a); Assert::int($b); return $a + $b; }
assert($value, $msg = NULL)- checks if value isTRUEbool($value, $msg = NULL)- checks if value isboolint($value, $msg = NULL)- checks if value isintintOrNull($value, $msg = NULL)- checks if value isint|NULLfloat($value, $msg = NULL)- checks if value isfloatfloatOrNull($value, $msg = NULL)- checks if value isfloat|NULLnumber($value, $msg = NULL)- checks if value isfloat|intnumberOrNull($value, $msg = NULL)- checks if value isfloat|int|NULLstring($value, $msg = NULL)- checks if value isstringstringOrNull($value, $msg = NULL)- checks if value isstring|NULLtype($value, $type, $msg = NULL)- checks if value is instance of given typetypeOrNull($value, $type, $msg = NULL)- checks if value is instance of given type orNULLnull($value, $msg = NULL)- checks if value isNULLin($value, $arr, $msg = NULL)- checks if value is in arrayinArray($value, $arr, $msg = NULL)- alias forAssert::in()
PhpStan extension
services: - class: CzProject\Assert\Bridges\PhpStan\StaticMethodTypeSpecifyingExtension tags: - phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension
License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/
统计信息
- 总下载量: 24.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 9
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-08-22