Package Data | |
---|---|
Maintainer Username: | arifmahmudrana |
Maintainer Contact: | arif_mahmud_rana@hotmail.com (Arif Mahmud Rana) |
Package Create Date: | 2017-02-05 |
Package Last Update: | 2017-05-13 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-27 15:14:12 |
Package Statistics | |
---|---|
Total Downloads: | 21 |
Monthly Downloads: | 2 |
Daily Downloads: | 1 |
Total Stars: | 4 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
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.