comparison vendor/masterminds/html5/src/HTML5/Serializer/RulesInterface.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
1 <?php 1 <?php
2 /** 2 /**
3 * @file 3 * @file
4 * The interface definition for Rules to generate output. 4 * The interface definition for Rules to generate output.
5 */ 5 */
6
6 namespace Masterminds\HTML5\Serializer; 7 namespace Masterminds\HTML5\Serializer;
7 8
8 /** 9 /**
9 * To create a new rule set for writing output the RulesInterface needs to be 10 * To create a new rule set for writing output the RulesInterface needs to be implemented.
10 * implemented. 11 * The resulting class can be specified in the options with the key of rules.
11 * The resulting class can be specified in the options with the
12 * key of rules.
13 * 12 *
14 * For an example implementation see \Masterminds\HTML5\Serializer\OutputRules. 13 * For an example implementation see Serializer\OutputRules.
15 */ 14 */
16 interface RulesInterface 15 interface RulesInterface
17 { 16 {
18
19 /** 17 /**
20 * The class constructor. 18 * The class constructor.
21 * 19 *
22 * Note, before the rules can be used a traverser must be registered. 20 * Note, before the rules can be used a traverser must be registered.
23 * 21 *
24 * @param mixed $output 22 * @param mixed $output The output stream to write output to.
25 * The output stream to write output to. 23 * @param array $options An array of options.
26 * @param array $options
27 * An array of options.
28 */ 24 */
29 public function __construct($output, $options = array()); 25 public function __construct($output, $options = array());
30 26
31 /** 27 /**
32 * Register the traverser used in but the rules. 28 * Register the traverser used in but the rules.
33 * 29 *
34 * Note, only one traverser can be used by the rules. 30 * Note, only one traverser can be used by the rules.
35 * 31 *
36 * @param \Masterminds\HTML5\Serializer\Traverser $traverser 32 * @param Traverser $traverser The traverser used in the rules.
37 * The traverser used in the rules. 33 *
38 * @return \Masterminds\HTML5\Serializer\RulesInterface $this for the current object. 34 * @return RulesInterface $this for the current object.
39 */ 35 */
40 public function setTraverser(\Masterminds\HTML5\Serializer\Traverser $traverser); 36 public function setTraverser(Traverser $traverser);
41 37
42 /** 38 /**
43 * Write a document element (\DOMDocument). 39 * Write a document element (\DOMDocument).
44 * 40 *
45 * Instead of returning the result write it to the output stream ($output) 41 * Instead of returning the result write it to the output stream ($output)
90 public function comment($ele); 86 public function comment($ele);
91 87
92 /** 88 /**
93 * Write a processor instruction. 89 * Write a processor instruction.
94 * 90 *
95 * To learn about processor instructions see \Masterminds\HTML5\InstructionProcessor 91 * To learn about processor instructions see InstructionProcessor
96 * 92 *
97 * Instead of returning the result write it to the output stream ($output) 93 * Instead of returning the result write it to the output stream ($output)
98 * that was passed into the constructor. 94 * that was passed into the constructor.
99 * 95 *
100 * @param mixed $ele 96 * @param mixed $ele