diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-12-31 03:56:32 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-01-09 00:13:30 +0300 |
commit | 8f342d0fb3f5661cb7fc1cafeabf93684ac478f8 (patch) | |
tree | 2d1f9efad0ef9a1d9e7a78817acae4350d04bcbb /core/Container | |
parent | b65ca1a727f96f4a32c26000f884e15bdba9fe54 (diff) |
Added a `StaticContainer::get()` method to avoid boilerplate
Diffstat (limited to 'core/Container')
-rw-r--r-- | core/Container/StaticContainer.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/Container/StaticContainer.php b/core/Container/StaticContainer.php index 048ba8a687..874851acde 100644 --- a/core/Container/StaticContainer.php +++ b/core/Container/StaticContainer.php @@ -76,4 +76,16 @@ class StaticContainer { self::$environment = $environment; } + + /** + * Proxy to Container::get() + * + * @param string $name Container entry name. + * @return mixed + * @throws \DI\NotFoundException + */ + public static function get($name) + { + return self::getContainer()->get($name); + } } |