original_string: protected function addConditions($query, $conditions)
      {
          foreach ($conditions as $key => $value) {
              if ($value instanceof Closure) {
                  $query->where(function ($query) use ($value) {
                      $value($query);
                  });
              } else {
                  $this->addWhere($query, $key, $value);
              }
          }
  
          return $query;
      }
code: protected function addConditions($query, $conditions)
      {
          foreach ($conditions as $key => $value) {
              if ($value instanceof Closure) {
                  $query->where(function ($query) use ($value) {
                      $value($query);
                  });
              } else {
                  $this->addWhere($query, $key, $value);
              }
          }
  
          return $query;
      }
code_tokens: protected function addConditions ( $ query , $ conditions ) { foreach ( $ conditions as $ key => $ value ) { if ( $ value instanceof Closure ) { $ query -> where ( function ( $ query ) use ( $ value ) { $ value ( $ query ) ; } ) ; } else { $ this -> addWhere ( $ query , $ key , $ value ) ; } } return $ query ; }
docstring: Add the given conditions to the query.
  
  @param  \Illuminate\Database\Query\Builder  $query
  @param  array  $conditions
  @return \Illuminate\Database\Query\Builder
docstring_tokens: Add the given conditions to the query .