Download the PHP package joshbrw/type-enforcement without Composer
On this page you can find all versions of the php package joshbrw/type-enforcement. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download joshbrw/type-enforcement
More information about joshbrw/type-enforcement
Files in joshbrw/type-enforcement
Download joshbrw/type-enforcement
More information about joshbrw/type-enforcement
Files in joshbrw/type-enforcement
Vendor joshbrw
Package type-enforcement
Short Description Enforce types and throw InvalidArgumentExceptions upon invalid types.
License MIT
Package type-enforcement
Short Description Enforce types and throw InvalidArgumentExceptions upon invalid types.
License MIT
Please rate this library. Is it a good library?
Informations about the package type-enforcement
Type Enforcement
If you've ever come across a time where you're writing loosely-coupled code but want to check a parameters type at the start of a method, then this library is for you.
How you're probably doing it
Let's refactor!
Custom Exception Messages
By default the package will provide a useful exception message, stating which type is expected and which type has been provided, i.e:
This exception message can be switched out by providing a custom message as the third parameter, i.e.:
Not a fan of static method calls?
This package also includes a helper method that accepts the same parameters:
All versions of type-enforcement with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0
The package joshbrw/type-enforcement contains the following files
Loading the files please wait ....