pool = $pool; } /** * Check if factory exists. * * @param string $name * @return bool */ public function has(string $name): bool { return isset($this->pool[$name]); } /** * Retrieve factory. * * @param string $name * @return DriverFactoryInterface * * @throws RuntimeException */ public function get(string $name): DriverFactoryInterface { if (!$this->has($name)) { throw new RuntimeException(__('Driver "%1" does not exist', $name)); } return $this->pool[$name]; } }