Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Shelamkoff authored Mar 9, 2021
1 parent 06c24c3 commit ca17934
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

````

0 comments on commit ca17934

Please sign in to comment.