Primo Committ
This commit is contained in:
46
vendor/league/commonmark/src/Inline/Element/AbstractInline.php
vendored
Normal file
46
vendor/league/commonmark/src/Inline/Element/AbstractInline.php
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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\Inline\Element;
|
||||
|
||||
use League\CommonMark\Node\Node;
|
||||
|
||||
/**
|
||||
* @method children() AbstractInline[]
|
||||
*/
|
||||
abstract class AbstractInline extends Node
|
||||
{
|
||||
/**
|
||||
* @var array<string, mixed>
|
||||
*
|
||||
* Used for storage of arbitrary data
|
||||
*/
|
||||
public $data = [];
|
||||
|
||||
public function isContainer(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getData(string $key, $default = null)
|
||||
{
|
||||
return isset($this->data[$key]) ? $this->data[$key] : $default;
|
||||
}
|
||||
}
|
||||
53
vendor/league/commonmark/src/Inline/Element/AbstractStringContainer.php
vendored
Normal file
53
vendor/league/commonmark/src/Inline/Element/AbstractStringContainer.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?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\Inline\Element;
|
||||
|
||||
class AbstractStringContainer extends AbstractInline
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $content = '';
|
||||
|
||||
/**
|
||||
* @param string $contents
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
public function __construct(string $contents = '', array $data = [])
|
||||
{
|
||||
$this->content = $contents;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getContent(): string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $contents
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setContent(string $contents)
|
||||
{
|
||||
$this->content = $contents;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
53
vendor/league/commonmark/src/Inline/Element/AbstractWebResource.php
vendored
Normal file
53
vendor/league/commonmark/src/Inline/Element/AbstractWebResource.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?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\Inline\Element;
|
||||
|
||||
abstract class AbstractWebResource extends AbstractInline
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $url;
|
||||
|
||||
public function __construct(string $url)
|
||||
{
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl(): string
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUrl(string $url)
|
||||
{
|
||||
$this->url = $url;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isContainer(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
19
vendor/league/commonmark/src/Inline/Element/Code.php
vendored
Normal file
19
vendor/league/commonmark/src/Inline/Element/Code.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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\Inline\Element;
|
||||
|
||||
class Code extends AbstractStringContainer
|
||||
{
|
||||
}
|
||||
23
vendor/league/commonmark/src/Inline/Element/Emphasis.php
vendored
Normal file
23
vendor/league/commonmark/src/Inline/Element/Emphasis.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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\Inline\Element;
|
||||
|
||||
class Emphasis extends AbstractInline
|
||||
{
|
||||
public function isContainer(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
19
vendor/league/commonmark/src/Inline/Element/HtmlInline.php
vendored
Normal file
19
vendor/league/commonmark/src/Inline/Element/HtmlInline.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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\Inline\Element;
|
||||
|
||||
class HtmlInline extends AbstractStringContainer
|
||||
{
|
||||
}
|
||||
31
vendor/league/commonmark/src/Inline/Element/Image.php
vendored
Normal file
31
vendor/league/commonmark/src/Inline/Element/Image.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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\Inline\Element;
|
||||
|
||||
class Image extends AbstractWebResource
|
||||
{
|
||||
public function __construct(string $url, ?string $label = null, ?string $title = null)
|
||||
{
|
||||
parent::__construct($url);
|
||||
|
||||
if (!empty($label)) {
|
||||
$this->appendChild(new Text($label));
|
||||
}
|
||||
|
||||
if (!empty($title)) {
|
||||
$this->data['title'] = $title;
|
||||
}
|
||||
}
|
||||
}
|
||||
31
vendor/league/commonmark/src/Inline/Element/Link.php
vendored
Normal file
31
vendor/league/commonmark/src/Inline/Element/Link.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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\Inline\Element;
|
||||
|
||||
class Link extends AbstractWebResource
|
||||
{
|
||||
public function __construct(string $url, ?string $label = null, ?string $title = null)
|
||||
{
|
||||
parent::__construct($url);
|
||||
|
||||
if (!empty($label)) {
|
||||
$this->appendChild(new Text($label));
|
||||
}
|
||||
|
||||
if (!empty($title)) {
|
||||
$this->data['title'] = $title;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
vendor/league/commonmark/src/Inline/Element/Newline.php
vendored
Normal file
35
vendor/league/commonmark/src/Inline/Element/Newline.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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\Inline\Element;
|
||||
|
||||
class Newline extends AbstractInline
|
||||
{
|
||||
// Any changes to these constants should be reflected in .phpstorm.meta.php
|
||||
const HARDBREAK = 0;
|
||||
const SOFTBREAK = 1;
|
||||
|
||||
/** @var int */
|
||||
protected $type;
|
||||
|
||||
public function __construct(int $breakType = self::HARDBREAK)
|
||||
{
|
||||
$this->type = $breakType;
|
||||
}
|
||||
|
||||
public function getType(): int
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
}
|
||||
23
vendor/league/commonmark/src/Inline/Element/Strong.php
vendored
Normal file
23
vendor/league/commonmark/src/Inline/Element/Strong.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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\Inline\Element;
|
||||
|
||||
class Strong extends AbstractInline
|
||||
{
|
||||
public function isContainer(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
28
vendor/league/commonmark/src/Inline/Element/Text.php
vendored
Normal file
28
vendor/league/commonmark/src/Inline/Element/Text.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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\Inline\Element;
|
||||
|
||||
class Text extends AbstractStringContainer
|
||||
{
|
||||
/**
|
||||
* @param string $character
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function append(string $character)
|
||||
{
|
||||
$this->content .= $character;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user