summaryrefslogtreecommitdiff
path: root/vendor/league/commonmark/src/Node/Node.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-07-15 11:08:16 +0100
committerGreg Roach <fisharebest@webtrees.net>2019-07-16 10:52:40 +0100
commit4a1f1d433794f86f893b59883147e57af4e94374 (patch)
tree5cb9572b1be24c130a5b8a86b0e1672f822cdfc4 /vendor/league/commonmark/src/Node/Node.php
parent22cfa91cf34e9677c2d99c712c2fc9e1c2c8f741 (diff)
downloadwebtrees-4a1f1d433794f86f893b59883147e57af4e94374.tar.gz
webtrees-4a1f1d433794f86f893b59883147e57af4e94374.tar.bz2
webtrees-4a1f1d433794f86f893b59883147e57af4e94374.zip
Package webuni/commonmark-table-extension is abandoned, you should avoid using it. Use league/commonmark-ext-table instead.
Diffstat (limited to 'vendor/league/commonmark/src/Node/Node.php')
-rw-r--r--vendor/league/commonmark/src/Node/Node.php28
1 files changed, 11 insertions, 17 deletions
diff --git a/vendor/league/commonmark/src/Node/Node.php b/vendor/league/commonmark/src/Node/Node.php
index 6a8d27d012..17f373ccca 100644
--- a/vendor/league/commonmark/src/Node/Node.php
+++ b/vendor/league/commonmark/src/Node/Node.php
@@ -2,8 +2,6 @@
namespace League\CommonMark\Node;
-use League\CommonMark\Util\ArrayCollection;
-
abstract class Node
{
/**
@@ -39,7 +37,7 @@ abstract class Node
/**
* @return Node|null
*/
- public function previous()
+ public function previous(): ?Node
{
return $this->previous;
}
@@ -47,7 +45,7 @@ abstract class Node
/**
* @return Node|null
*/
- public function next()
+ public function next(): ?Node
{
return $this->next;
}
@@ -55,7 +53,7 @@ abstract class Node
/**
* @return Node|null
*/
- public function parent()
+ public function parent(): ?Node
{
return $this->parent;
}
@@ -145,12 +143,12 @@ abstract class Node
/**
* @return bool
*/
- abstract public function isContainer();
+ abstract public function isContainer(): bool;
/**
* @return Node|null
*/
- public function firstChild()
+ public function firstChild(): ?Node
{
return $this->firstChild;
}
@@ -158,7 +156,7 @@ abstract class Node
/**
* @return Node|null
*/
- public function lastChild()
+ public function lastChild(): ?Node
{
return $this->lastChild;
}
@@ -166,7 +164,7 @@ abstract class Node
/**
* @return Node[]
*/
- public function children()
+ public function children(): iterable
{
$children = [];
for ($current = $this->firstChild; null !== $current; $current = $current->next) {
@@ -220,16 +218,12 @@ abstract class Node
/**
* Replace all children of given node with collection of another
*
- * @param array $children
+ * @param iterable $children
*
* @return $this
*/
- public function replaceChildren(array $children)
+ public function replaceChildren(iterable $children)
{
- if (!is_array($children) && !(is_object($children) && $children instanceof ArrayCollection)) {
- throw new \InvalidArgumentException(sprintf('Expect iterable, got %s', get_class($children)));
- }
-
$this->detachChildren();
foreach ($children as $item) {
$this->appendChild($item);
@@ -241,7 +235,7 @@ abstract class Node
/**
* @return int
*/
- public function getDepth()
+ public function getDepth(): int
{
return $this->depth;
}
@@ -249,7 +243,7 @@ abstract class Node
/**
* @return NodeWalker
*/
- public function walker()
+ public function walker(): NodeWalker
{
return new NodeWalker($this);
}