Skip to content

Commit

Permalink
Updating docs with PSR-11 information and setThrowIfNotFound() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
brentscheffler committed Oct 16, 2019
1 parent 5cc1542 commit 90dfe93
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Caboodle

A simple configuration manager with lazy loading from files, AWS Secrets Manager, or any other source.
A simple PSR-11 compliant configuration manager with lazy loading from files, AWS Secrets Manager, or any other source.

## Installation

Expand Down Expand Up @@ -60,7 +60,7 @@ return [
The ```AwsLoader``` will attempt to load configuration data from AWS Secrets Manager.

```NOTES```
* If your AWS Secrets Manager keys include dots ("."), the loader will not be able to resolve the key name properly. It is suggested that your AWS keys be of the form ```db/default``` as suggested by AWS best practices.
* If your AWS Secrets Manager keys include dots ("."), the loader will not be able to resolve the key name properly. It is suggested that your AWS keys be of the form ```prod/db/default``` as suggested by AWS best practices.
* ```VersionId``` and ```StageVersion``` options are not available with this loader at this time.
* ```SecretBinary``` values are not supported at this time. The loader will only look for values in the ```SecretString``` property.

Expand Down Expand Up @@ -89,6 +89,17 @@ Your configuration files may contain nested associative arrays that can be acces
```php
$config->get("database.connections.default.host");
```
## PSR-11 note

By default, Caboodle will return a ```null``` if an item is not found in the item store.

However, PSR-11 states that when an item is not found, it should throw an instance of ```NotFoundExceptionInterface```.

If you would like Caboodle to throw an exception when an item is not found, you may call the ```setThrowIfNotFound()``` method.

```php
$config->setThrowIfNotFound(true);
```

## Key hinting

Expand Down

0 comments on commit 90dfe93

Please sign in to comment.