Skip to content

widmogrod/php-exceptions

Repository files navigation

PHP Exceptions Build Status

Introduction

How many times you throw exceptions in your code? and how many of them are repeating?

This library collects general use cases and provide nice ::assert API.

Use it, don't waste your development time for custom exceptions, use one of our exceptions classes.

Usage

Tired of writing is_array($value) || $value instanceof \Traversable? Use predefined assertions and save your time, like so:

use Exception\InvalidTypeException;

function thatCanCantBeViolated($arrayOrTraversable) {
    InvalidTypeException::assertIsTraversable($arrayOrTraversable);
    // do your regular work
}

Installation

composer require widmogrod/php-exceptions

Development

This repository follows semantic versioning concept. If you want to contribute, just follow GitHub workflow and open a pull request.

Testing

Quality assurance is brought to you by PHPSpec

composer test

About

Collection PHP exceptions grouped by functionality with nice ::assert API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages