Total Complexity | 3 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class HTMLPurifier_ConfigSchema_Interchange |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * Name of the application this schema is describing. |
||
13 | * @type string |
||
14 | */ |
||
15 | public $name; |
||
16 | |||
17 | /** |
||
18 | * Array of Directive ID => array(directive info) |
||
19 | * @type HTMLPurifier_ConfigSchema_Interchange_Directive[] |
||
20 | */ |
||
21 | public $directives = array(); |
||
22 | |||
23 | /** |
||
24 | * Adds a directive array to $directives |
||
25 | * @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive |
||
26 | * @throws HTMLPurifier_ConfigSchema_Exception |
||
27 | */ |
||
28 | public function addDirective($directive) |
||
29 | { |
||
30 | if (isset($this->directives[$i = $directive->id->toString()])) { |
||
31 | throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine directive '$i'"); |
||
32 | } |
||
33 | $this->directives[$i] = $directive; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Convenience function to perform standard validation. Throws exception |
||
38 | * on failed validation. |
||
39 | */ |
||
40 | public function validate() |
||
44 | } |
||
45 | } |
||
48 |