Dhii / containers

A selection of PSR-11 containers for utility, simplicity, and ease
MIT License
8 stars 3 forks source link

Missing No-Op Container #16

Closed XedinUnknown closed 4 years ago

XedinUnknown commented 4 years ago

The Problem

Often times, container usage depends on certain environmental factors. For example, a user session container may not be available unless a user is actually logged in. This leads to extra conditions, nullable services, and other noise that adds complexity to the code.

Suggested Solution

Add a no-op container. This can be used in applications if an actual implementation is not available, without extra checks or nullables - just as if it was a real one.