Download the PHP package awjudd/guard-clauses without Composer
On this page you can find all versions of the php package awjudd/guard-clauses. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download awjudd/guard-clauses
More information about awjudd/guard-clauses
Files in awjudd/guard-clauses
Download awjudd/guard-clauses
More information about awjudd/guard-clauses
Files in awjudd/guard-clauses
Vendor awjudd
Package guard-clauses
Short Description A simple package with guard clause helpers.
License MIT
Package guard-clauses
Short Description A simple package with guard clause helpers.
License MIT
Please rate this library. Is it a good library?
Informations about the package guard-clauses
Guard Clauses
A guard clause is a software pattern that simplifies complex functions by "failing fast", checking for invalid inputs up front and immediately failing if any are found.
Sample Usage
Avoiding Primative Obsession:
By doing this, you are then able to quickly make sure your objects are valid upon creation.
You can also use it in methods:
Why is this better? It reduces the overall nesting required in your code. While the below is a simple problem, you can see how it can propagate.
All versions of guard-clauses with dependencies
PHP Build Version
Package Version
No informations.
The package awjudd/guard-clauses contains the following files
Loading the files please wait ....