From 6abe84f98061894bac170c633485903ef3c95d01 Mon Sep 17 00:00:00 2001 From: Joao Gilberto Magalhaes Date: Sat, 30 Dec 2023 11:11:54 -0600 Subject: [PATCH] Update config --- docs/psr11.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/psr11.md b/docs/psr11.md index 42e734f..874173a 100644 --- a/docs/psr11.md +++ b/docs/psr11.md @@ -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;