original_string: public function addMapping($key, array $accepted_names, $required = true)
      {
          $lower_accepted_names = [];
  
          foreach($accepted_names as $name) {
              $lower_name = strtolower($name);
  
              if ($this->getMapping($lower_name) !== false) {
                  throw new MappingOverlapException(sprintf('Column name %s already mapped on %s', $name, $key));
              }
  
              $lower_accepted_names[] = $lower_name;
          }
  
          $this->mappings[$key] = [
              'accepted_names' => $lower_accepted_names,
              'required' => $required,
              'index' => null,
          ];
  
          return $this;
      }
code: public function addMapping($key, array $accepted_names, $required = true)
      {
          $lower_accepted_names = [];
  
          foreach($accepted_names as $name) {
              $lower_name = strtolower($name);
  
              if ($this->getMapping($lower_name) !== false) {
                  throw new MappingOverlapException(sprintf('Column name %s already mapped on %s', $name, $key));
              }
  
              $lower_accepted_names[] = $lower_name;
          }
  
          $this->mappings[$key] = [
              'accepted_names' => $lower_accepted_names,
              'required' => $required,
              'index' => null,
          ];
  
          return $this;
      }
code_tokens: public function addMapping ( $ key , array $ accepted_names , $ required = true ) { $ lower_accepted_names = [ ] ; foreach ( $ accepted_names as $ name ) { $ lower_name = strtolower ( $ name ) ; if ( $ this -> getMapping ( $ lower_name ) !== false ) { throw new MappingOverlapException ( sprintf ( 'Column name %s already mapped on %s' , $ name , $ key ) ) ; } $ lower_accepted_names [ ] = $ lower_name ; } $ this -> mappings [ $ key ] = [ 'accepted_names' => $ lower_accepted_names , 'required' => $ required , 'index' => null , ] ; return $ this ; }
docstring: Add a mapping expectation
  
  @param string $key Mapping identifier
  @param array $accepted_names Allowed columns names
  @param boolean $required Column is required
  @return $this
  @throws MappingOverlapException
docstring_tokens: Add a mapping expectation