Downloads
Stars
Version
This is nothing but a key value store in the current context. You store value & in other places you retrieve value by it's key.
composer require arifmahmudrana/context
and that's it.
use ArifMahmudRana\Context\ContextContainer;
ContextContainer::set('user', User::find(1))//Save user Returns true
use ArifMahmudRana\Context\ContextContainer;
ContextContainer::get('user')//Get user
use ArifMahmudRana\Context\ContextContainer;
ContextContainer::has('user')//Return true
use ArifMahmudRana\Context\ContextContainer;
ContextContainer::all()//Returns key value ['user' => User Object] default empty array
use ArifMahmudRana\Context\ContextContainer;
ContextContainer::remove('user')//Returns true removes the key
CannotInstantiateClassExceptions
exception\InvalidArgumentException
exceptionTo Run the tests
./vendor/bin/phpunit //run phpunit
All contributions are welcome, for any bug, issue or merge request please refer to CONTRIBUTING.md
Released under the MIT License, see LICENSE.