try / predict-is
标量值简单比较预测
1.0.0
2017-10-26 05:40 UTC
This package is not auto-updated.
Last update: 2024-09-15 04:31:25 UTC
README
标量值简单比较预测
安装
$ composer require try/predict-is
用法
<?php require_once '/path/to/autoload.php'; use TryPhp\PredictIsTrait; $assertions = new class() { use PredictIsTrait(); } $assertions->is(3, 3); // won't throw an exception $assertions->predictException('something', 'something else'); // will throw an exception
API
方法
is($actual, $expected)
比较标量值并如果它们不相等则抛出异常的方法。
参数
相关包
许可
GPL-2.0 © Willi Eßer