Download the PHP package mattjmattj/maybe without Composer
On this page you can find all versions of the php package mattjmattj/maybe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mattjmattj/maybe
More information about mattjmattj/maybe
Files in mattjmattj/maybe
Download mattjmattj/maybe
More information about mattjmattj/maybe
Files in mattjmattj/maybe
Vendor mattjmattj
Package maybe
Short Description Fake objects for cleaner code and error handling
License BSD-2-Clause
Package maybe
Short Description Fake objects for cleaner code and error handling
License BSD-2-Clause
Please rate this library. Is it a good library?
Informations about the package maybe
Maybe
Maybe wraps a class and provides a way to abstract away error handling when dealing with undefined instances. It might help implement feature switches, dev/prod environments switches, etc.
Installation
with composer
Basic usage
Example
Examples are provided in the "example" folder:
- Log : An example of how to use Maybe with an IoC container to wrap a "log" feature and write code with no worries.
- Email : An example of how to use Maybe to create fake objects from interfaces only. An example of "deep" wrapping.
Warning
Not every kind of object should be wrapped. Typically you will want to wrap classes that provide logs, debug, cache, events, etc. You don't want to wrap "useful" classes that actually alter the logic of your code.
License
Maybe is licensed under BSD-2-Clause license.
All versions of maybe with dependencies
PHP Build Version
Package Version
Requires
phpspec/prophecy Version
~1.3
The package mattjmattj/maybe contains the following files
Loading the files please wait ....