From ca17934f88de7d235383e46f406c955d75b71a4d Mon Sep 17 00:00:00 2001 From: Andrey Shelamkoff Date: Tue, 9 Mar 2021 16:07:10 +0300 Subject: [PATCH] Update README.md --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index db38a98..5ca5438 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,39 @@ ```bash composer require bermudaphp/registry ```` + +# Set +```php +Registry::set('message', 'Hello World'); + +Registry::getInstance()->offsetSet('message', 'Hello World!'); +Registry::getInstance()['message'] = 'Hello, Jane!'; + +```` + +# Get +```php +Registry::get('MessaGe', 'default value'); // default value + +Registry::getInstance()->offsetGet('message'); // Hello, Jane! +Registry::getInstance()['message']; // Hello, Jane!; + +```` + +# Exists +```php +Registry::has('appVersion'); // false + +Registry::getInstance()->offsetExists('message'); // true +isset(Registry::getInstance()['message']); // true; + +```` + +# Unset +```php +Registry::remove('message'); + +Registry::getInstance()->offsetUnset('message'); +unset(Registry::getInstance()['message']); + +````