Remove decorator pattern from validator; we'll only have one decorator which invokes...
[htmlpurifier.git] / library / HTMLPurifier / ConfigSchema / Validator.php
blobe87302a0daf603d39705275a4dd5fc24cf7bc8d0
1 <?php
3 /**
4 * Base validator for HTMLPurifier_ConfigSchema_Interchange
5 */
6 class HTMLPurifier_ConfigSchema_Validator
9 /**
10 * Validates and filters a namespace.
12 public function validateNamespace(&$arr, $interchange) {
13 $this->validate($arr, $interchange, 'namespace');
16 /**
17 * Validates and filters a directive.
19 public function validateDirective(&$arr, $interchange) {
20 $this->validate($arr, $interchange, 'directive');
23 /**
24 * Common validator, throwing an exception on error. It can
25 * also performing filtering or evaluation functions.
27 * @note This is strictly for convenience reasons when subclasing.
29 * @param $arr Array to validate.
30 * @param $interchange HTMLPurifier_ConfigSchema_Interchange object
31 * that is being processed.
32 * @param $type Type of object being validated, this saves a little work
33 * if only cosmetic changes are being made between namespaces
34 * and directives.
36 protected function validate(&$arr, $interchange, $type) {}