2017 © Pedro Peláez
 

library guard

assertion library with reusable guard function

image

texdc/guard

assertion library with reusable guard function

  • Tuesday, October 17, 2017
  • by texdc
  • Repository
  • 0 Watchers
  • 0 Stars
  • 27 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

guard

An extension for beberlei/assert that adds some extra assertions and a factory function to simplify usage., (*1)

installation

composer require texdc/guard

usage

namespace my\lib;

use function texdc\guard\verify;

function storeRating(int $rating) : void {
    verify($rating)->numericRange(1, 10, 'rating should be from 1 - 10');
    // ...
}

function speak(string $message, ?int $times = null) : void {
    verify($message)->notEmpty('message is required')->length(256, 'message is too long');
    verify($times, 'invalid multiplier')->nullOr()->isModulus(8);
    // ...
}

The Versions

17/10 2017

dev-master

9999999-dev

assertion library with reusable guard function

  Sources   Download

MIT

The Requires

 

The Development Requires

by George Cooksey

17/10 2017

v1.0.0

1.0.0.0

assertion library with reusable guard function

  Sources   Download

MIT

The Requires

 

The Development Requires

by George Cooksey