[3.1.1] Implement SafeObject.
[htmlpurifier.git] / library / HTMLPurifier / Token.php
blob8803307bda9eef68435cdcd8fc6ab36476d05706
1 <?php
3 /**
4 * Abstract base token class that all others inherit from.
5 */
6 class HTMLPurifier_Token {
7 public $line; /**< Line number node was on in source document. Null if unknown. */
9 /**
10 * Lookup array of processing that this token is exempt from.
11 * Currently, valid values are "ValidateAttributes" and
12 * "MakeWellFormed_TagClosedError"
14 public $armor = array();
16 public function __get($n) {
17 if ($n === 'type') {
18 trigger_error('Deprecated type property called; use instanceof', E_USER_NOTICE);
19 switch (get_class($this)) {
20 case 'HTMLPurifier_Token_Start': return 'start';
21 case 'HTMLPurifier_Token_Empty': return 'empty';
22 case 'HTMLPurifier_Token_End': return 'end';
23 case 'HTMLPurifier_Token_Text': return 'text';
24 case 'HTMLPurifier_Token_Comment': return 'comment';
25 default: return null;