original_string: public function validate($interchange)
      {
          $this->interchange = $interchange;
          $this->aliases = array();
          // PHP is a bit lax with integer <=> string conversions in
          // arrays, so we don't use the identical !== comparison
          foreach ($interchange->directives as $i => $directive) {
              $id = $directive->id->toString();
              if ($i != $id) {
                  $this->error(false, "Integrity violation: key '$i' does not match internal id '$id'");
              }
              $this->validateDirective($directive);
          }
          return true;
      }
code: public function validate($interchange)
      {
          $this->interchange = $interchange;
          $this->aliases = array();
          // PHP is a bit lax with integer <=> string conversions in
          // arrays, so we don't use the identical !== comparison
          foreach ($interchange->directives as $i => $directive) {
              $id = $directive->id->toString();
              if ($i != $id) {
                  $this->error(false, "Integrity violation: key '$i' does not match internal id '$id'");
              }
              $this->validateDirective($directive);
          }
          return true;
      }
code_tokens: public function validate ( $ interchange ) { $ this -> interchange = $ interchange ; $ this -> aliases = array ( ) ; // PHP is a bit lax with integer <=> string conversions in // arrays, so we don't use the identical !== comparison foreach ( $ interchange -> directives as $ i => $ directive ) { $ id = $ directive -> id -> toString ( ) ; if ( $ i != $ id ) { $ this -> error ( false , "Integrity violation: key '$i' does not match internal id '$id'" ) ; } $ this -> validateDirective ( $ directive ) ; } return true ; }
docstring: Validates a fully-formed interchange object.
  @param HTMLPurifier_ConfigSchema_Interchange $interchange
  @return bool
docstring_tokens: Validates a fully - formed interchange object .