original_string: public function build($interchange, $hash)
      {
          if (!$hash instanceof HTMLPurifier_StringHash) {
              $hash = new HTMLPurifier_StringHash($hash);
          }
          if (!isset($hash['ID'])) {
              throw new HTMLPurifier_ConfigSchema_Exception('Hash does not have any ID');
          }
          if (strpos($hash['ID'], '.') === false) {
              if (count($hash) == 2 && isset($hash['DESCRIPTION'])) {
                  $hash->offsetGet('DESCRIPTION'); // prevent complaining
              } else {
                  throw new HTMLPurifier_ConfigSchema_Exception('All directives must have a namespace');
              }
          } else {
              $this->buildDirective($interchange, $hash);
          }
          $this->_findUnused($hash);
      }
code: public function build($interchange, $hash)
      {
          if (!$hash instanceof HTMLPurifier_StringHash) {
              $hash = new HTMLPurifier_StringHash($hash);
          }
          if (!isset($hash['ID'])) {
              throw new HTMLPurifier_ConfigSchema_Exception('Hash does not have any ID');
          }
          if (strpos($hash['ID'], '.') === false) {
              if (count($hash) == 2 && isset($hash['DESCRIPTION'])) {
                  $hash->offsetGet('DESCRIPTION'); // prevent complaining
              } else {
                  throw new HTMLPurifier_ConfigSchema_Exception('All directives must have a namespace');
              }
          } else {
              $this->buildDirective($interchange, $hash);
          }
          $this->_findUnused($hash);
      }
code_tokens: public function build ( $ interchange , $ hash ) { if ( ! $ hash instanceof HTMLPurifier_StringHash ) { $ hash = new HTMLPurifier_StringHash ( $ hash ) ; } if ( ! isset ( $ hash [ 'ID' ] ) ) { throw new HTMLPurifier_ConfigSchema_Exception ( 'Hash does not have any ID' ) ; } if ( strpos ( $ hash [ 'ID' ] , '.' ) === false ) { if ( count ( $ hash ) == 2 && isset ( $ hash [ 'DESCRIPTION' ] ) ) { $ hash -> offsetGet ( 'DESCRIPTION' ) ; // prevent complaining } else { throw new HTMLPurifier_ConfigSchema_Exception ( 'All directives must have a namespace' ) ; } } else { $ this -> buildDirective ( $ interchange , $ hash ) ; } $ this -> _findUnused ( $ hash ) ; }
docstring: Builds an interchange object based on a hash.
  @param HTMLPurifier_ConfigSchema_Interchange $interchange HTMLPurifier_ConfigSchema_Interchange object to build
  @param HTMLPurifier_StringHash $hash source data
  @throws HTMLPurifier_ConfigSchema_Exception
docstring_tokens: Builds an interchange object based on a hash .