container = $container; } /** * @param string $controller_name * * @return Controller * * @throws LogicException */ public function create( string $controller_name ): Controller { if ( ! $this->container->has( $controller_name ) ) { throw new LogicException( 'Controller name: ' . $controller_name . ' is not registered in DI container' ); } return $this->container->get( $controller_name ); } }