original_string: protected function parseTransformer($transformer, Model $model)
      {
          if ($transformer instanceof Transformer) {
              $relations = $transformer->allRelationsAllowed() ? $this->resolveRelations($model) : $transformer->getRelations();
              $transformer = $transformer->setRelations($relations);
  
          } elseif (! is_callable($transformer)) {
              throw new InvalidTransformerException($model);
          }
  
          return $transformer;
      }
code: protected function parseTransformer($transformer, Model $model)
      {
          if ($transformer instanceof Transformer) {
              $relations = $transformer->allRelationsAllowed() ? $this->resolveRelations($model) : $transformer->getRelations();
              $transformer = $transformer->setRelations($relations);
  
          } elseif (! is_callable($transformer)) {
              throw new InvalidTransformerException($model);
          }
  
          return $transformer;
      }
code_tokens: protected function parseTransformer ( $ transformer , Model $ model ) { if ( $ transformer instanceof Transformer ) { $ relations = $ transformer -> allRelationsAllowed ( ) ? $ this -> resolveRelations ( $ model ) : $ transformer -> getRelations ( ) ; $ transformer = $ transformer -> setRelations ( $ relations ) ; } elseif ( ! is_callable ( $ transformer ) ) { throw new InvalidTransformerException ( $ model ) ; } return $ transformer ; }
docstring: Parse a transformer class and set relations.
  
  @param  \Flugg\Responder\Transformer|callable $transformer
  @param  \Illuminate\Database\ELoquent\Model   $model
  @return \Flugg\Responder\Transformer|callable
  @throws \InvalidTransformerException
docstring_tokens: Parse a transformer class and set relations .