Skip to content

Commit

Permalink
Update config
Browse files Browse the repository at this point in the history
  • Loading branch information
byjg committed Dec 30, 2023
1 parent bd22067 commit 6abe84f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions docs/psr11.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,18 @@ You can change the environments in the `RestReferenceArchitecture\Psr11` class a
```php
public static function environment()
{
$dev = new Environment('dev');
$test = new Environment('test', [$dev]);
$staging = new Environment('staging', [$dev], new FileSystemCacheEngine());
$prod = new Environment('prod', [$staging, $dev], new FileSystemCacheEngine());

if (is_null(self::$definition)) {
self::$definition = (new Definition())
->addConfig('dev')
->addConfig('test', inheritFrom: ['dev'])
->addConfig('staging', inheritFrom: ['dev'])
->addConfig('prod', inheritFrom: ['staging'])
->inheritFrom('dev');
// ->setCache($somePsr16Implementation); // This will cache the result;
->addEnvironment($dev)
->addEnvironment($test)
->addEnvironment($staging)
->addEnvironment($prod)
;
}

return self::$definition;
Expand Down

0 comments on commit 6abe84f

Please sign in to comment.