original_string: public function createAppropriateIterator(Response $response)
      {
          $this->checkResponseFormat($response);
  
          set_error_handler(function() { /* ignore errors */ });
          $arr = json_decode($response->getBody(), true, 512, 1);
          restore_error_handler();
  
          $objects = [];
          foreach ($arr['objects'] as $object) {
              if (isset($this->apiEntities[$object['type']])) {
                  $class = $this->apiEntities[$object['type']];
              } else {
                  $class = $this->apiEntities['*'];
              }
              $objects[] = new $class($object);
          }
  
          return new EntityIterator($objects, $response);
      }
code: public function createAppropriateIterator(Response $response)
      {
          $this->checkResponseFormat($response);
  
          set_error_handler(function() { /* ignore errors */ });
          $arr = json_decode($response->getBody(), true, 512, 1);
          restore_error_handler();
  
          $objects = [];
          foreach ($arr['objects'] as $object) {
              if (isset($this->apiEntities[$object['type']])) {
                  $class = $this->apiEntities[$object['type']];
              } else {
                  $class = $this->apiEntities['*'];
              }
              $objects[] = new $class($object);
          }
  
          return new EntityIterator($objects, $response);
      }
code_tokens: public function createAppropriateIterator ( Response $ response ) { $ this -> checkResponseFormat ( $ response ) ; set_error_handler ( function ( ) { /* ignore errors */ } ) ; $ arr = json_decode ( $ response -> getBody ( ) , true , 512 , 1 ) ; restore_error_handler ( ) ; $ objects = [ ] ; foreach ( $ arr [ 'objects' ] as $ object ) { if ( isset ( $ this -> apiEntities [ $ object [ 'type' ] ] ) ) { $ class = $ this -> apiEntities [ $ object [ 'type' ] ] ; } else { $ class = $ this -> apiEntities [ '*' ] ; } $ objects [ ] = new $ class ( $ object ) ; } return new EntityIterator ( $ objects , $ response ) ; }
docstring: Creates an appropriate Entity from a given Response
  If no valid Entity can be found for typo of API, the Wildcard entity is selected
  
  @todo: remove error avoidance when issue 12 is fixed: https://github.com/Swader/diffbot-php-client/issues/12
  @param Response $response
  @return EntityIterator
  @throws DiffbotException
docstring_tokens: Creates an appropriate Entity from a given Response If no valid Entity can be found for typo of API the Wildcard entity is selected