diff options
| author | Greg Roach <fisharebest@gmail.com> | 2018-01-09 13:37:46 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2018-01-10 22:19:52 +0000 |
| commit | e195df77d56d9863b3b38e4c1f75dc54bf0138dd (patch) | |
| tree | f69b92122c76e8ae449b5dd2f083edf45d7c8fdc /vendor/league/commonmark/src/Node/Node.php | |
| parent | 6214363af62618c3780500b5b6aa1ea171aba81a (diff) | |
| download | webtrees-e195df77d56d9863b3b38e4c1f75dc54bf0138dd.tar.gz webtrees-e195df77d56d9863b3b38e4c1f75dc54bf0138dd.tar.bz2 webtrees-e195df77d56d9863b3b38e4c1f75dc54bf0138dd.zip | |
webuni/commonmark-table-extension issue #12 now resolved so can upgrade to the latest league/commonmark
Diffstat (limited to 'vendor/league/commonmark/src/Node/Node.php')
| -rw-r--r-- | vendor/league/commonmark/src/Node/Node.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/league/commonmark/src/Node/Node.php b/vendor/league/commonmark/src/Node/Node.php index fb8683c889..55be265333 100644 --- a/vendor/league/commonmark/src/Node/Node.php +++ b/vendor/league/commonmark/src/Node/Node.php @@ -7,6 +7,11 @@ use League\CommonMark\Util\ArrayCollection; abstract class Node { /** + * @var int + */ + protected $depth = 0; + + /** * @var Node|null */ protected $parent; @@ -61,6 +66,7 @@ abstract class Node protected function setParent(Node $node = null) { $this->parent = $node; + $this->depth = ($node === null) ? 0 : $node->depth + 1; } /** @@ -129,6 +135,7 @@ abstract class Node $this->parent = null; $this->next = null; $this->previous = null; + $this->depth = 0; } /** @@ -226,6 +233,14 @@ abstract class Node } /** + * @return int + */ + public function getDepth() + { + return $this->depth; + } + + /** * @return NodeWalker */ public function walker() |
