summaryrefslogtreecommitdiff
path: root/vendor/league/commonmark/src/Extension/Mention/Mention.php
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2020-12-27 20:12:27 +0000
committerGreg Roach <greg@subaqua.co.uk>2021-03-11 10:22:29 +0000
commitf7cf8a155e2743f3d124eef3d30a558ab062fa4b (patch)
treea45052d9dc68b2049f4848e1043f56f6782ad3dd /vendor/league/commonmark/src/Extension/Mention/Mention.php
parent7989fe578b0082b5d3378ee0b461904deb3802d1 (diff)
downloadwebtrees-f7cf8a155e2743f3d124eef3d30a558ab062fa4b.tar.gz
webtrees-f7cf8a155e2743f3d124eef3d30a558ab062fa4b.tar.bz2
webtrees-f7cf8a155e2743f3d124eef3d30a558ab062fa4b.zip
Remove vendor dir, add support for PHP 8.0, drop support for PHP 7.1 and 7.2
Diffstat (limited to 'vendor/league/commonmark/src/Extension/Mention/Mention.php')
-rw-r--r--vendor/league/commonmark/src/Extension/Mention/Mention.php104
1 files changed, 0 insertions, 104 deletions
diff --git a/vendor/league/commonmark/src/Extension/Mention/Mention.php b/vendor/league/commonmark/src/Extension/Mention/Mention.php
deleted file mode 100644
index 3344d53ead..0000000000
--- a/vendor/league/commonmark/src/Extension/Mention/Mention.php
+++ /dev/null
@@ -1,104 +0,0 @@
-<?php
-
-/*
- * This file is part of the league/commonmark package.
- *
- * (c) Colin O'Dell <colinodell@gmail.com>
- *
- * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
- * - (c) John MacFarlane
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace League\CommonMark\Extension\Mention;
-
-use League\CommonMark\Inline\Element\Link;
-use League\CommonMark\Inline\Element\Text;
-
-class Mention extends Link
-{
- /** @var string */
- private $symbol;
-
- /** @var string */
- private $identifier;
-
- /**
- * @param string $symbol
- * @param string $identifier
- * @param string $label
- */
- public function __construct(string $symbol, string $identifier, string $label = null)
- {
- $this->symbol = $symbol;
- $this->identifier = $identifier;
-
- parent::__construct('', $label ?? \sprintf('%s%s', $symbol, $identifier));
- }
-
- /**
- * @return string|null
- */
- public function getLabel(): ?string
- {
- if (($labelNode = $this->findLabelNode()) === null) {
- return null;
- }
-
- return $labelNode->getContent();
- }
-
- /**
- * @return string
- */
- public function getIdentifier(): string
- {
- return $this->identifier;
- }
-
- /**
- * @return string
- */
- public function getSymbol(): string
- {
- return $this->symbol;
- }
-
- /**
- * @return bool
- */
- public function hasUrl(): bool
- {
- return !empty($this->url);
- }
-
- /**
- * @param string $label
- *
- * @return $this
- */
- public function setLabel(string $label): self
- {
- if (($labelNode = $this->findLabelNode()) === null) {
- $labelNode = new Text();
- $this->prependChild($labelNode);
- }
-
- $labelNode->setContent($label);
-
- return $this;
- }
-
- private function findLabelNode(): ?Text
- {
- foreach ($this->children() as $child) {
- if ($child instanceof Text) {
- return $child;
- }
- }
-
- return null;
- }
-}