Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | declare(strict_types=1); |
| 3 | /** |
| 4 | * Pop PHP Framework (https://www.popphp.org/) |
| 5 | * |
| 6 | * @link https://github.com/popphp/popphp-framework |
| 7 | * @author Nick Sagona, III <nick@popphp.org> |
| 8 | * @copyright Copyright (c) 2009-2026 Nick Sagona, III |
| 9 | * @license https://www.popphp.org/license New BSD License |
| 10 | */ |
| 11 | |
| 12 | /** |
| 13 | * @namespace |
| 14 | */ |
| 15 | namespace Pop\Dom; |
| 16 | |
| 17 | use InvalidArgumentException; |
| 18 | |
| 19 | /** |
| 20 | * Node interface |
| 21 | * |
| 22 | * @category Pop |
| 23 | * @package Pop\Dom |
| 24 | * @author Nick Sagona, III <nick@popphp.org> |
| 25 | * @copyright Copyright (c) 2009-2026 Nick Sagona, III |
| 26 | * @license https://www.popphp.org/license New BSD License |
| 27 | * @version 5.0.0 |
| 28 | */ |
| 29 | interface NodeInterface |
| 30 | { |
| 31 | |
| 32 | /** |
| 33 | * Return the indent |
| 34 | * |
| 35 | * @return ?string |
| 36 | */ |
| 37 | public function getIndent(): ?string; |
| 38 | |
| 39 | /** |
| 40 | * Set the indent |
| 41 | * |
| 42 | * @param string $indent |
| 43 | * @return NodeInterface |
| 44 | */ |
| 45 | public function setIndent(string $indent): NodeInterface; |
| 46 | |
| 47 | /** |
| 48 | * Return the parent node |
| 49 | * |
| 50 | * @return NodeInterface|null |
| 51 | */ |
| 52 | public function getParent(): NodeInterface|null; |
| 53 | |
| 54 | /** |
| 55 | * Set the parent node |
| 56 | * |
| 57 | * @param NodeInterface $parent |
| 58 | * @return NodeInterface |
| 59 | */ |
| 60 | public function setParent(NodeInterface $parent): NodeInterface; |
| 61 | |
| 62 | /** |
| 63 | * Add a child to the object |
| 64 | * |
| 65 | * @param Child $c |
| 66 | * @throws InvalidArgumentException |
| 67 | * @return NodeInterface |
| 68 | */ |
| 69 | public function addChild(Child $c): NodeInterface; |
| 70 | |
| 71 | /** |
| 72 | * Add children to the object |
| 73 | * |
| 74 | * @param mixed $children |
| 75 | * @throws Exception |
| 76 | * @return NodeInterface |
| 77 | */ |
| 78 | public function addChildren(mixed $children): NodeInterface; |
| 79 | |
| 80 | /** |
| 81 | * Get whether or not the child object has children |
| 82 | * |
| 83 | * @return bool |
| 84 | */ |
| 85 | public function hasChildren(): bool; |
| 86 | |
| 87 | /** |
| 88 | * Get whether or not the child object has children (alias) |
| 89 | * |
| 90 | * @return bool |
| 91 | */ |
| 92 | public function hasChildNodes(): bool; |
| 93 | |
| 94 | /** |
| 95 | * Get the child nodes of the object |
| 96 | * |
| 97 | * @param int $i |
| 98 | * @return Child|null |
| 99 | */ |
| 100 | public function getChild(int $i): Child|null; |
| 101 | |
| 102 | /** |
| 103 | * Get the child nodes of the object |
| 104 | * |
| 105 | * @return array |
| 106 | */ |
| 107 | public function getChildren(): array; |
| 108 | |
| 109 | /** |
| 110 | * Get the child nodes of the object (alias) |
| 111 | * |
| 112 | * @return array |
| 113 | */ |
| 114 | public function getChildNodes(): array; |
| 115 | |
| 116 | /** |
| 117 | * Remove all child nodes from the object |
| 118 | * |
| 119 | * @param int $i |
| 120 | * @return void |
| 121 | */ |
| 122 | public function removeChild(int $i): void; |
| 123 | |
| 124 | /** |
| 125 | * Remove all child nodes from the object |
| 126 | * |
| 127 | * @return void |
| 128 | */ |
| 129 | public function removeChildren(): void; |
| 130 | |
| 131 | } |