original_string: protected function materializeResource(Resource $resource)
      {
          foreach ($resource as $method) {
              $request = $method->getRequest();
              if ($request) {
                  $method->setRequest(new Schema($request->getDefinition()));
              }
  
              $responses = $method->getResponses();
              foreach ($responses as $statusCode => $response) {
                  $method->addResponse($statusCode, new Schema($response->getDefinition()));
              }
          }
      }
code: protected function materializeResource(Resource $resource)
      {
          foreach ($resource as $method) {
              $request = $method->getRequest();
              if ($request) {
                  $method->setRequest(new Schema($request->getDefinition()));
              }
  
              $responses = $method->getResponses();
              foreach ($responses as $statusCode => $response) {
                  $method->addResponse($statusCode, new Schema($response->getDefinition()));
              }
          }
      }
code_tokens: protected function materializeResource ( Resource $ resource ) { foreach ( $ resource as $ method ) { $ request = $ method -> getRequest ( ) ; if ( $ request ) { $ method -> setRequest ( new Schema ( $ request -> getDefinition ( ) ) ) ; } $ responses = $ method -> getResponses ( ) ; foreach ( $ responses as $ statusCode => $ response ) { $ method -> addResponse ( $ statusCode , new Schema ( $ response -> getDefinition ( ) ) ) ; } } }
docstring: A resource can contain schema definitions which are only resolved if we
  actual call the getDefinition method i.e. the schema is stored in a
  database. So before we cache the documentation we must get the actual
  definition object which we can serialize
  
  @param \PSX\Api\Resource $resource
docstring_tokens: A resource can contain schema definitions which are only resolved if we actual call the getDefinition method i . e . the schema is stored in a database . So before we cache the documentation we must get the actual definition object which we can serialize