cybersai/ussd-decision

Making chained decision using an object class

v0.1.0 2020-03-14 15:34 UTC

This package is auto-updated.

Last update: 2024-12-05 00:33:28 UTC


README

Packagist Version Travis (.com) GitHub repo size GitHub

Making decision using an Object Oriented Decision fallback

No Real Documentation for now, but for now you can read the tests.

include 'vendor/autoload.php';

use Cybersai\UssdDecision\UssdDecision;

echo UssdDecision::using('0241122331') // Argument to use for decision making
    ->integer('It an integer') // Return this is the argument is an integer
    ->equal('0241122442', 'It my Number') // Return this is the argument is equal to the parameter given
    ->in(['05451111111', '05452222222'], 'It a schools line') // Return this is the argument is array provider
    ->length(6, 'Too short') // Return this is the argument length is 6
    ->phoneNumber('It a phone number') // Return this is the argument is a valid phone number
    ->any('Did not match any') // Just return this
    ->outcome(); // Give the outcome of the decision chain
// Output
It a phone number

Installation

composer require cybersai/ussd-decision