Whoops, forgot to edit WHATSNEW
[htmlpurifier.git] / library / HTMLPurifier / ConfigSchema / Interchange / Id.php
blob126f09d957c0406d07cd803328d89d5cc2356c38
1 <?php
3 /**
4 * Represents a directive ID in the interchange format.
5 */
6 class HTMLPurifier_ConfigSchema_Interchange_Id
9 /**
10 * @type string
12 public $key;
14 /**
15 * @param string $key
17 public function __construct($key)
19 $this->key = $key;
22 /**
23 * @return string
24 * @warning This is NOT magic, to ensure that people don't abuse SPL and
25 * cause problems for PHP 5.0 support.
27 public function toString()
29 return $this->key;
32 /**
33 * @return string
35 public function getRootNamespace()
37 return substr($this->key, 0, strpos($this->key, "."));
40 /**
41 * @return string
43 public function getDirective()
45 return substr($this->key, strpos($this->key, ".") + 1);
48 /**
49 * @param string $id
50 * @return HTMLPurifier_ConfigSchema_Interchange_Id
52 public static function make($id)
54 return new HTMLPurifier_ConfigSchema_Interchange_Id($id);
58 // vim: et sw=4 sts=4