From ff5aeeacef46968a2ec0f28aa013b0c95e918909 Mon Sep 17 00:00:00 2001 From: Jay Potter Date: Wed, 12 Aug 2026 15:20:32 -0400 Subject: [PATCH] add Behaviour --- src/Potter/Environment/Behaviour.php | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/Potter/Environment/Behaviour.php diff --git a/src/Potter/Environment/Behaviour.php b/src/Potter/Environment/Behaviour.php new file mode 100644 index 0000000..5540b31 --- /dev/null +++ b/src/Potter/Environment/Behaviour.php @@ -0,0 +1,33 @@ +addShared(Environment::class, function () { + return Environment::createImmutable(getcwd()); + }); + } + + private static function addEnvironmentBehaviour(Container $container): void + { + static::addEnvironment($container); + self::getEnvironment($container)->required(['APPLICATION_NAME']); + } + + private static function getEnvironment(Container $container): Environment + { + return $container->get(Environment::class); + } + + private static function hasEnvironment(Container $container): bool + { + return $container->has(Environment::class); + } +}