From d6940c3cc8eebd72627d42a0c0b3139f951716f4 Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Wed, 11 Jun 2014 10:05:54 +0200 Subject: PSR-0 vendor namespace --- src/HTML5.php | 20 +++++++++++--------- src/HTML5/Elements.php | 22 +++++++++++----------- src/HTML5/Entities.php | 2 +- src/HTML5/Exception.php | 2 +- src/HTML5/InstructionProcessor.php | 12 ++++++------ src/HTML5/Parser/CharacterReference.php | 6 +++--- src/HTML5/Parser/DOMTreeBuilder.php | 6 +++--- src/HTML5/Parser/EventHandler.php | 2 +- src/HTML5/Parser/FileInputStream.php | 2 +- src/HTML5/Parser/InputStream.php | 2 +- src/HTML5/Parser/ParseError.php | 2 +- src/HTML5/Parser/Scanner.php | 4 ++-- src/HTML5/Parser/StringInputStream.php | 2 +- src/HTML5/Parser/Tokenizer.php | 8 ++++---- src/HTML5/Parser/TreeBuildingRules.php | 4 ++-- src/HTML5/Parser/UTF8Utils.php | 2 +- src/HTML5/Serializer/HTML5Entities.php | 4 ++-- src/HTML5/Serializer/OutputRules.php | 14 +++++++------- src/HTML5/Serializer/RulesInterface.php | 12 ++++++------ src/HTML5/Serializer/Traverser.php | 2 +- 20 files changed, 66 insertions(+), 64 deletions(-) (limited to 'src') diff --git a/src/HTML5.php b/src/HTML5.php index 4515884..121ef54 100644 --- a/src/HTML5.php +++ b/src/HTML5.php @@ -1,12 +1,14 @@ errors = array(); $events = new DOMTreeBuilder(); $scanner = new Scanner($input); @@ -159,7 +161,7 @@ class HTML5 * Lower-level loading function. This requires an input stream instead * of a string, file, or resource. */ - public function parseFragment(\HTML5\Parser\InputStream $input) { + public function parseFragment(\Masterminds\HTML5\Parser\InputStream $input) { $events = new DOMTreeBuilder(TRUE); $scanner = new Scanner($input); $parser = new Tokenizer($scanner, $events); diff --git a/src/HTML5/Elements.php b/src/HTML5/Elements.php index 678b3ac..31e9e4c 100644 --- a/src/HTML5/Elements.php +++ b/src/HTML5/Elements.php @@ -2,12 +2,12 @@ /** * Provide general element functions. */ -namespace HTML5; +namespace Masterminds\HTML5; /** - * This class provides general information about HTML5 elements, - * including syntactic and semantic issues. Parsers and serializers can - * use this class as a reference point for information about the rules + * This class provides general information about HTML5 elements, + * including syntactic and semantic issues. Parsers and serializers can + * use this class as a reference point for information about the rules * of various HTML5 elements. * * @todo consider using a bitmask table lookup. There is enough overlap in @@ -39,8 +39,8 @@ class Elements { // "pre", "listing" // "form" // "plaintext" - /** - * Indicates that if a previous event is for a P tag, that element + /** + * Indicates that if a previous event is for a P tag, that element * should be considered closed. */ const AUTOCLOSE_P = 16; @@ -82,7 +82,7 @@ class Elements { "command" => 9, // NORMAL | VOID_TAG //"data" => 1, // This is highly experimental and only part of the whatwg spec (not w3c). See https://developer.mozilla.org/en-US/docs/HTML/Element/data "datalist" => 1, - "dd" => 65, // NORMAL | BLOCK_TAG + "dd" => 65, // NORMAL | BLOCK_TAG "del" => 1, "details" => 17, // NORMAL | AUTOCLOSE_P, "dfn" => 1, @@ -189,7 +189,7 @@ class Elements { * * In our case we are only concerned with presentation MathML and not content * MathML. There is a nice list of this subset at https://developer.mozilla.org/en-US/docs/MathML/Element. - * + * * @var array */ public static $mathml = array( @@ -520,8 +520,8 @@ class Elements { * * This includes html5 elements along with other allowed embedded content * such as svg and mathml. - * - * @param string $name + * + * @param string $name * The name of the element. * * @return bool @@ -594,7 +594,7 @@ class Elements { * Normalize a MathML attribute name to its proper case and form. * * Note, all MathML element names are lowercase. - * + * * @param string $name * The name of the attribute. * diff --git a/src/HTML5/Entities.php b/src/HTML5/Entities.php index e5de9e2..2174f0d 100644 --- a/src/HTML5/Entities.php +++ b/src/HTML5/Entities.php @@ -1,5 +1,5 @@ processor = $proc; } diff --git a/src/HTML5/Parser/EventHandler.php b/src/HTML5/Parser/EventHandler.php index 4034938..4a99aa6 100644 --- a/src/HTML5/Parser/EventHandler.php +++ b/src/HTML5/Parser/EventHandler.php @@ -1,5 +1,5 @@ out = $output; } - public function setTraverser(\HTML5\Serializer\Traverser $traverser) { + public function setTraverser(\Masterminds\HTML5\Serializer\Traverser $traverser) { $this->traverser = $traverser; return $this; @@ -208,7 +208,7 @@ class OutputRules implements \HTML5\Serializer\RulesInterface { * @param string $text * The string to put into the output. * - * @return HTML5\Serializer\Traverser + * @return Masterminds\HTML5\Serializer\Traverser * $this so it can be used in chaining. */ protected function wr($text) { @@ -219,7 +219,7 @@ class OutputRules implements \HTML5\Serializer\RulesInterface { /** * Write a new line character. * - * @return HTML5\Serializer\Traverser + * @return Masterminds\HTML5\Serializer\Traverser * $this so it can be used in chaining. */ protected function nl() { @@ -274,7 +274,7 @@ class OutputRules implements \HTML5\Serializer\RulesInterface { // If a version earlier than 5.4 html5 entities are not entirely handled. // This manually handles them. else { - return strtr($text, \HTML5\Serializer\HTML5Entities::$map); + return strtr($text, \Masterminds\HTML5\Serializer\HTML5Entities::$map); } } diff --git a/src/HTML5/Serializer/RulesInterface.php b/src/HTML5/Serializer/RulesInterface.php index 18ac8ca..86f44af 100644 --- a/src/HTML5/Serializer/RulesInterface.php +++ b/src/HTML5/Serializer/RulesInterface.php @@ -3,14 +3,14 @@ * @file * The interface definition for Rules to generate output. */ -namespace HTML5\Serializer; +namespace Masterminds\HTML5\Serializer; /** * To create a new rule set for writing output the RulesInterface needs to be * implemented. The resulting class can be specified in the options with the * key of rules. * - * For an example implementation see \HTML5\Serializer\OutputRules. + * For an example implementation see \Masterminds\HTML5\Serializer\OutputRules. */ interface RulesInterface { @@ -31,12 +31,12 @@ interface RulesInterface { * * Note, only one traverser can be used by the rules. * - * @param \HTML5\Serializer\Traverser $traverser + * @param \Masterminds\HTML5\Serializer\Traverser $traverser * The traverser used in the rules. - * @return \HTML5\Serializer\RulesInterface + * @return \Masterminds\HTML5\Serializer\RulesInterface * $this for the current object. */ - public function setTraverser(\HTML5\Serializer\Traverser $traverser); + public function setTraverser(\Masterminds\HTML5\Serializer\Traverser $traverser); /** * Write a document element (\DOMDocument). @@ -91,7 +91,7 @@ interface RulesInterface { /** * Write a processor instruction. * - * To learn about processor instructions see \HTML5\InstructionProcessor + * To learn about processor instructions see \Masterminds\HTML5\InstructionProcessor * * Instead of returning the result write it to the output stream ($output) * that was passed into the constructor. diff --git a/src/HTML5/Serializer/Traverser.php b/src/HTML5/Serializer/Traverser.php index 0794458..bcb9814 100644 --- a/src/HTML5/Serializer/Traverser.php +++ b/src/HTML5/Serializer/Traverser.php @@ -1,5 +1,5 @@