From 0e89a81a3036209fa90fd187bd59e104367ce5e5 Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Mon, 27 May 2013 21:42:05 -0400 Subject: Added an interface for Output Rules to document how they work. --- src/HTML5/Exception.php | 5 ++ src/HTML5/Serializer/OutputRules.php | 2 +- src/HTML5/Serializer/RulesInterface.php | 90 +++++++++++++++++++++++++++++++++ src/HTML5/Serializer/Traverser.php | 3 ++ 4 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 src/HTML5/Exception.php create mode 100644 src/HTML5/Serializer/RulesInterface.php (limited to 'src/HTML5') diff --git a/src/HTML5/Exception.php b/src/HTML5/Exception.php new file mode 100644 index 0000000..fab97d0 --- /dev/null +++ b/src/HTML5/Exception.php @@ -0,0 +1,5 @@ +out = $out; $this->options = $options; + if (!isset($this->options['rules'])) { + throw new \HTML5\Exception('No Rules specified for output generation.'); + } $rulesClass = $this->options['rules']; $this->rules = new $rulesClass($this, $out, $this->options); } -- cgit v1.2.3