original_string: public static function buildValidation(array $schema, $name = null)
      {
          $validation = new NestedValidation($name);
  
          foreach ($schema as $key => $value) {
  
              if (!is_array($value)) {
                  trigger_error('parsing error', E_USER_ERROR);
              }
  
              if (self::isNestedValidation($value)) {
                  $validation->addValidation(self::buildValidation($value, $key));
              } else {
                  $validation->addValidation(self::buildKeyValidation($value, $key));
              }
  
          }
          return $validation;
      }
code: public static function buildValidation(array $schema, $name = null)
      {
          $validation = new NestedValidation($name);
  
          foreach ($schema as $key => $value) {
  
              if (!is_array($value)) {
                  trigger_error('parsing error', E_USER_ERROR);
              }
  
              if (self::isNestedValidation($value)) {
                  $validation->addValidation(self::buildValidation($value, $key));
              } else {
                  $validation->addValidation(self::buildKeyValidation($value, $key));
              }
  
          }
          return $validation;
      }
code_tokens: public static function buildValidation ( array $ schema , $ name = null ) { $ validation = new NestedValidation ( $ name ) ; foreach ( $ schema as $ key => $ value ) { if ( ! is_array ( $ value ) ) { trigger_error ( 'parsing error' , E_USER_ERROR ) ; } if ( self :: isNestedValidation ( $ value ) ) { $ validation -> addValidation ( self :: buildValidation ( $ value , $ key ) ) ; } else { $ validation -> addValidation ( self :: buildKeyValidation ( $ value , $ key ) ) ; } } return $ validation ; }
docstring: This function builds a validation acording to the specifgications of the json file
  
  @param array $schema
  @param null $name
  @return NestedValidation
docstring_tokens: This function builds a validation acording to the specifgications of the json file