public function get($id) { try { return $this->container[$id]; } catch (\InvalidArgumentException $prev) { throw AcclimateNotFoundException::fromPrevious($id, $prev); } catch (\Exception $prev) { throw AcclimateContainerException::fromPrevious($id, $prev); } }
/** * Finds an entry of the container by delegating the get call to a FIFO queue of internal containers * * {@inheritDoc} */ public function get($id) { /** @var ContainerInterface $container */ foreach ($this->containers as $container) { if ($container->has($id)) { return $container->get($id); } } throw NotFoundException::fromPrevious($id); }
public function get($id) { try { return $this->container->get($id); } catch (PhpDiNotFoundException $prev) { throw AcclimateNotFoundException::fromPrevious($id, $prev); } catch (\Exception $prev) { throw AcclimateContainerException::fromPrevious($id, $prev); } }
public function get($id) { try { $result = $this->container->get($id); } catch (\Exception $prev) { throw AcclimateContainerException::fromPrevious($id, $prev); } if ($result === null) { throw AcclimateNotFoundException::fromPrevious($id); } return $result; }
public function get($id) { if ($this->container->bound($id)) { try { return $this->container->make($id); } catch (\Exception $prev) { throw AcclimateContainerException::fromPrevious($id, $prev); } } else { throw AcclimateNotFoundException::fromPrevious($id); } }
public function get($id) { if (isset($this->data[$id])) { try { if ($this->data[$id] instanceof \Closure) { $this->data[$id] = call_user_func($this->data[$id], $this->delegateLookupContainer); } } catch (\Exception $prev) { throw ContainerException::fromPrevious($id, $prev); } return $this->data[$id]; } else { throw NotFoundException::fromPrevious($id); } }
/** * {@inheritdoc} */ public function get($id) { throw NotFoundException::fromPrevious($id); }