try/predict-is

Simple comparison prediction for scalar values

Installs: 77

Dependents: 2

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/try/predict-is

1.0.0 2017-10-26 05:40 UTC

This package is not auto-updated.

Last update: 2025-09-28 09:55:54 UTC


README

Simple comparison prediction for scalar values

Build Status

Install

$ composer require try/predict-is

Usage

<?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

Methods

is($actual, $expected)

Method to compare scalar values and throw an Exception if they do not equal.

Arguments
Arguments Type Description
$actual mixed Actual value that shall be checked.
$expected mixed Expected value $actual is compared to.

Related packages

License

GPL-2.0 © Willi Eßer