From 6a18422b099aa61d79c2d6977720254bcaff1a93 Mon Sep 17 00:00:00 2001 From: eater Date: Sat, 27 Jan 2018 18:44:28 +0100 Subject: [PATCH] Add container access --- src/Instance.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Instance.php b/src/Instance.php index 5e33251..41c4724 100644 --- a/src/Instance.php +++ b/src/Instance.php @@ -224,4 +224,16 @@ class Instance $this->container = $builder->build(); } + + public function has(string $key): bool { + return $this->container->has($key); + } + + public function get(string $key, $default = null) { + if (!$this->container->has($key)) { + return $default; + } + + return $this->container->get($key); + } } \ No newline at end of file