@@ -10,5 +10,5 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class DOMNode extends \DOMNode |
| 12 | 12 | { |
| 13 | - use NodeTrait; |
|
| 13 | + use NodeTrait; |
|
| 14 | 14 | } |
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | |
| 7 | 7 | class DOMAttr extends \DOMAttr |
| 8 | 8 | { |
| 9 | - use NodeTrait; |
|
| 9 | + use NodeTrait; |
|
| 10 | 10 | } |
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | |
| 7 | 7 | class DOMText extends \DOMText |
| 8 | 8 | { |
| 9 | - use NodeTrait; |
|
| 9 | + use NodeTrait; |
|
| 10 | 10 | } |
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | |
| 7 | 7 | class DOMEntityReference extends \DOMEntityReference |
| 8 | 8 | { |
| 9 | - use NodeTrait; |
|
| 9 | + use NodeTrait; |
|
| 10 | 10 | } |
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | |
| 7 | 7 | class DOMNotation extends \DOMNotation |
| 8 | 8 | { |
| 9 | - use NodeTrait; |
|
| 9 | + use NodeTrait; |
|
| 10 | 10 | } |
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | |
| 7 | 7 | class DOMComment extends \DOMComment |
| 8 | 8 | { |
| 9 | - use NodeTrait; |
|
| 9 | + use NodeTrait; |
|
| 10 | 10 | } |
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | |
| 7 | 7 | class DOMDocumentFragment extends \DOMDocumentFragment |
| 8 | 8 | { |
| 9 | - use NodeTrait; |
|
| 9 | + use NodeTrait; |
|
| 10 | 10 | } |
@@ -14,69 +14,69 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class DOMNodeList implements \Countable, \IteratorAggregate |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * @var array |
|
| 19 | - */ |
|
| 20 | - protected $items = []; |
|
| 17 | + /** |
|
| 18 | + * @var array |
|
| 19 | + */ |
|
| 20 | + protected $items = []; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * @var int |
|
| 24 | - */ |
|
| 25 | - protected $length = 0; |
|
| 22 | + /** |
|
| 23 | + * @var int |
|
| 24 | + */ |
|
| 25 | + protected $length = 0; |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * To allow access to length in the same way that DOMNodeList allows. |
|
| 29 | - * |
|
| 30 | - * {@inheritdoc} |
|
| 31 | - */ |
|
| 32 | - public function __get($name) |
|
| 33 | - { |
|
| 34 | - switch ($name) { |
|
| 35 | - case 'length': |
|
| 36 | - return $this->length; |
|
| 37 | - default: |
|
| 38 | - trigger_error(sprintf('Undefined property: %s::%s', static::class, $name)); |
|
| 39 | - } |
|
| 40 | - } |
|
| 27 | + /** |
|
| 28 | + * To allow access to length in the same way that DOMNodeList allows. |
|
| 29 | + * |
|
| 30 | + * {@inheritdoc} |
|
| 31 | + */ |
|
| 32 | + public function __get($name) |
|
| 33 | + { |
|
| 34 | + switch ($name) { |
|
| 35 | + case 'length': |
|
| 36 | + return $this->length; |
|
| 37 | + default: |
|
| 38 | + trigger_error(sprintf('Undefined property: %s::%s', static::class, $name)); |
|
| 39 | + } |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * @param DOMNode|DOMElement|DOMComment $node |
|
| 44 | - * |
|
| 45 | - * @return DOMNodeList |
|
| 46 | - */ |
|
| 47 | - public function add($node) |
|
| 48 | - { |
|
| 49 | - $this->items[] = $node; |
|
| 50 | - $this->length++; |
|
| 42 | + /** |
|
| 43 | + * @param DOMNode|DOMElement|DOMComment $node |
|
| 44 | + * |
|
| 45 | + * @return DOMNodeList |
|
| 46 | + */ |
|
| 47 | + public function add($node) |
|
| 48 | + { |
|
| 49 | + $this->items[] = $node; |
|
| 50 | + $this->length++; |
|
| 51 | 51 | |
| 52 | - return $this; |
|
| 53 | - } |
|
| 52 | + return $this; |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * @param int $offset |
|
| 57 | - * |
|
| 58 | - * @return DOMNode|DOMElement|DOMComment |
|
| 59 | - */ |
|
| 60 | - public function item(int $offset) |
|
| 61 | - { |
|
| 62 | - return $this->items[$offset]; |
|
| 63 | - } |
|
| 55 | + /** |
|
| 56 | + * @param int $offset |
|
| 57 | + * |
|
| 58 | + * @return DOMNode|DOMElement|DOMComment |
|
| 59 | + */ |
|
| 60 | + public function item(int $offset) |
|
| 61 | + { |
|
| 62 | + return $this->items[$offset]; |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * @return int|void |
|
| 67 | - */ |
|
| 68 | - public function count(): int |
|
| 69 | - { |
|
| 70 | - return $this->length; |
|
| 71 | - } |
|
| 65 | + /** |
|
| 66 | + * @return int|void |
|
| 67 | + */ |
|
| 68 | + public function count(): int |
|
| 69 | + { |
|
| 70 | + return $this->length; |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - /** |
|
| 74 | - * To make it compatible with iterator_to_array() function. |
|
| 75 | - * |
|
| 76 | - * {@inheritdoc} |
|
| 77 | - */ |
|
| 78 | - public function getIterator(): \ArrayIterator |
|
| 79 | - { |
|
| 80 | - return new \ArrayIterator($this->items); |
|
| 81 | - } |
|
| 73 | + /** |
|
| 74 | + * To make it compatible with iterator_to_array() function. |
|
| 75 | + * |
|
| 76 | + * {@inheritdoc} |
|
| 77 | + */ |
|
| 78 | + public function getIterator(): \ArrayIterator |
|
| 79 | + { |
|
| 80 | + return new \ArrayIterator($this->items); |
|
| 81 | + } |
|
| 82 | 82 | } |
@@ -32,10 +32,10 @@ |
||
| 32 | 32 | public function __get($name) |
| 33 | 33 | { |
| 34 | 34 | switch ($name) { |
| 35 | - case 'length': |
|
| 36 | - return $this->length; |
|
| 37 | - default: |
|
| 38 | - trigger_error(sprintf('Undefined property: %s::%s', static::class, $name)); |
|
| 35 | + case 'length': |
|
| 36 | + return $this->length; |
|
| 37 | + default: |
|
| 38 | + trigger_error(sprintf('Undefined property: %s::%s', static::class, $name)); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
@@ -6,25 +6,25 @@ |
||
| 6 | 6 | |
| 7 | 7 | class DOMDocument extends \DOMDocument |
| 8 | 8 | { |
| 9 | - use NodeTrait; |
|
| 9 | + use NodeTrait; |
|
| 10 | 10 | |
| 11 | - public function __construct($version, $encoding) |
|
| 12 | - { |
|
| 13 | - parent::__construct($version, $encoding); |
|
| 11 | + public function __construct($version, $encoding) |
|
| 12 | + { |
|
| 13 | + parent::__construct($version, $encoding); |
|
| 14 | 14 | |
| 15 | - $this->registerNodeClass('DOMAttr', DOMAttr::class); |
|
| 16 | - $this->registerNodeClass('DOMCdataSection', DOMCdataSection::class); |
|
| 17 | - $this->registerNodeClass('DOMCharacterData', DOMCharacterData::class); |
|
| 18 | - $this->registerNodeClass('DOMComment', DOMComment::class); |
|
| 19 | - $this->registerNodeClass('DOMDocument', self::class); |
|
| 20 | - $this->registerNodeClass('DOMDocumentFragment', DOMDocumentFragment::class); |
|
| 21 | - $this->registerNodeClass('DOMDocumentType', DOMDocumentType::class); |
|
| 22 | - $this->registerNodeClass('DOMElement', DOMElement::class); |
|
| 23 | - $this->registerNodeClass('DOMEntity', DOMEntity::class); |
|
| 24 | - $this->registerNodeClass('DOMEntityReference', DOMEntityReference::class); |
|
| 25 | - $this->registerNodeClass('DOMNode', DOMNode::class); |
|
| 26 | - $this->registerNodeClass('DOMNotation', DOMNotation::class); |
|
| 27 | - $this->registerNodeClass('DOMProcessingInstruction', DOMProcessingInstruction::class); |
|
| 28 | - $this->registerNodeClass('DOMText', DOMText::class); |
|
| 29 | - } |
|
| 15 | + $this->registerNodeClass('DOMAttr', DOMAttr::class); |
|
| 16 | + $this->registerNodeClass('DOMCdataSection', DOMCdataSection::class); |
|
| 17 | + $this->registerNodeClass('DOMCharacterData', DOMCharacterData::class); |
|
| 18 | + $this->registerNodeClass('DOMComment', DOMComment::class); |
|
| 19 | + $this->registerNodeClass('DOMDocument', self::class); |
|
| 20 | + $this->registerNodeClass('DOMDocumentFragment', DOMDocumentFragment::class); |
|
| 21 | + $this->registerNodeClass('DOMDocumentType', DOMDocumentType::class); |
|
| 22 | + $this->registerNodeClass('DOMElement', DOMElement::class); |
|
| 23 | + $this->registerNodeClass('DOMEntity', DOMEntity::class); |
|
| 24 | + $this->registerNodeClass('DOMEntityReference', DOMEntityReference::class); |
|
| 25 | + $this->registerNodeClass('DOMNode', DOMNode::class); |
|
| 26 | + $this->registerNodeClass('DOMNotation', DOMNotation::class); |
|
| 27 | + $this->registerNodeClass('DOMProcessingInstruction', DOMProcessingInstruction::class); |
|
| 28 | + $this->registerNodeClass('DOMText', DOMText::class); |
|
| 29 | + } |
|
| 30 | 30 | } |