code: public function resolve($id, ServerRequestInterface $request = null)
      {
          $reflection = new \ReflectionClass($id);
  
          if ($constructor = $reflection->getConstructor()) {
              $arguments = array();
  
              foreach ($constructor->getParameters() as $parameter) {
                  $argument = $this->argument($parameter);
  
                  $arguments[] = $this->request($argument, $request);
              }
  
              return $reflection->newInstanceArgs($arguments);
          }
  
          return $this->extra->get($id);
      }
docs: Resolves the specified identifier to an instance.
  
  @throws \Psr\Container\NotFoundExceptionInterface
  
  @param  string                                        $id
  @param  \Psr\Http\Message\ServerRequestInterface|null $request
  @return mixed