mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Constructor shouldn't be part of public API
This commit is contained in:
parent
f83ee87902
commit
3c0b528d54
@ -22,7 +22,7 @@ final class BlockQuote implements ContinuableBlock
|
|||||||
/**
|
/**
|
||||||
* @param Lines $Lines
|
* @param Lines $Lines
|
||||||
*/
|
*/
|
||||||
public function __construct($Lines)
|
private function __construct($Lines)
|
||||||
{
|
{
|
||||||
$this->Lines = $Lines;
|
$this->Lines = $Lines;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ final class FencedCode implements ContinuableBlock
|
|||||||
* @param int $openerLength
|
* @param int $openerLength
|
||||||
* @param bool $isComplete
|
* @param bool $isComplete
|
||||||
*/
|
*/
|
||||||
public function __construct($code, $infostring, $marker, $openerLength, $isComplete)
|
private function __construct($code, $infostring, $marker, $openerLength, $isComplete)
|
||||||
{
|
{
|
||||||
$this->code = $code;
|
$this->code = $code;
|
||||||
$this->infostring = $infostring;
|
$this->infostring = $infostring;
|
||||||
|
@ -23,7 +23,7 @@ final class Header implements Block
|
|||||||
* @param string $text
|
* @param string $text
|
||||||
* @param 1|2|3|4|5|6 $level
|
* @param 1|2|3|4|5|6 $level
|
||||||
*/
|
*/
|
||||||
public function __construct($text, $level)
|
private function __construct($text, $level)
|
||||||
{
|
{
|
||||||
$this->text = $text;
|
$this->text = $text;
|
||||||
$this->level = $level;
|
$this->level = $level;
|
||||||
|
@ -19,7 +19,7 @@ final class IndentedCode implements ContinuableBlock
|
|||||||
/**
|
/**
|
||||||
* @param string $code
|
* @param string $code
|
||||||
*/
|
*/
|
||||||
public function __construct($code)
|
private function __construct($code)
|
||||||
{
|
{
|
||||||
$this->code = $code;
|
$this->code = $code;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ final class Paragraph implements ContinuableBlock
|
|||||||
/**
|
/**
|
||||||
* @param string $text
|
* @param string $text
|
||||||
*/
|
*/
|
||||||
public function __construct($text)
|
private function __construct($text)
|
||||||
{
|
{
|
||||||
$this->text = $text;
|
$this->text = $text;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ final class Reference implements StateUpdatingBlock
|
|||||||
/** @var State */
|
/** @var State */
|
||||||
private $State;
|
private $State;
|
||||||
|
|
||||||
public function __construct(State $State)
|
private function __construct(State $State)
|
||||||
{
|
{
|
||||||
$this->State = $State;
|
$this->State = $State;
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,10 @@ use Erusev\Parsedown\State;
|
|||||||
|
|
||||||
final class Rule implements Block
|
final class Rule implements Block
|
||||||
{
|
{
|
||||||
|
private function __construct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Context $Context
|
* @param Context $Context
|
||||||
* @param State $State
|
* @param State $State
|
||||||
|
@ -23,7 +23,7 @@ final class SetextHeader implements AcquisitioningBlock
|
|||||||
* @param string $text
|
* @param string $text
|
||||||
* @param 1|2 $level
|
* @param 1|2 $level
|
||||||
*/
|
*/
|
||||||
public function __construct($text, $level)
|
private function __construct($text, $level)
|
||||||
{
|
{
|
||||||
$this->text = $text;
|
$this->text = $text;
|
||||||
$this->level = $level;
|
$this->level = $level;
|
||||||
|
@ -53,7 +53,7 @@ final class TList implements ContinuableBlock
|
|||||||
* @param string $markerType
|
* @param string $markerType
|
||||||
* @param string $markerTypeRegex
|
* @param string $markerTypeRegex
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
private function __construct(
|
||||||
$Lis,
|
$Lis,
|
||||||
$listStart,
|
$listStart,
|
||||||
$isLoose,
|
$isLoose,
|
||||||
|
@ -35,7 +35,7 @@ final class Table implements AcquisitioningBlock, ContinuableBlock
|
|||||||
* @param array<int, array<int, string>> $rows
|
* @param array<int, array<int, string>> $rows
|
||||||
* @param bool $acquired
|
* @param bool $acquired
|
||||||
*/
|
*/
|
||||||
public function __construct($alignments, $headerCells, $rows, $acquired = false)
|
private function __construct($alignments, $headerCells, $rows, $acquired = false)
|
||||||
{
|
{
|
||||||
$this->alignments = $alignments;
|
$this->alignments = $alignments;
|
||||||
$this->headerCells = $headerCells;
|
$this->headerCells = $headerCells;
|
||||||
|
@ -20,7 +20,7 @@ final class Code implements Inline
|
|||||||
* @param string $text
|
* @param string $text
|
||||||
* @param int $width
|
* @param int $width
|
||||||
*/
|
*/
|
||||||
public function __construct($text, $width)
|
private function __construct($text, $width)
|
||||||
{
|
{
|
||||||
$this->text = $text;
|
$this->text = $text;
|
||||||
$this->width = $width;
|
$this->width = $width;
|
||||||
|
@ -24,7 +24,7 @@ final class Email implements Inline
|
|||||||
* @param string $url
|
* @param string $url
|
||||||
* @param int $width
|
* @param int $width
|
||||||
*/
|
*/
|
||||||
public function __construct($text, $url, $width)
|
private function __construct($text, $url, $width)
|
||||||
{
|
{
|
||||||
$this->text = $text;
|
$this->text = $text;
|
||||||
$this->url = $url;
|
$this->url = $url;
|
||||||
|
@ -38,7 +38,7 @@ final class Emphasis implements Inline
|
|||||||
* @param 'em'|'strong' $type
|
* @param 'em'|'strong' $type
|
||||||
* @param int $width
|
* @param int $width
|
||||||
*/
|
*/
|
||||||
public function __construct($text, $type, $width)
|
private function __construct($text, $type, $width)
|
||||||
{
|
{
|
||||||
$this->text = $text;
|
$this->text = $text;
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
|
@ -20,7 +20,7 @@ final class EscapeSequence implements Inline
|
|||||||
/**
|
/**
|
||||||
* @param string $text
|
* @param string $text
|
||||||
*/
|
*/
|
||||||
public function __construct($text)
|
private function __construct($text)
|
||||||
{
|
{
|
||||||
$this->text = $text;
|
$this->text = $text;
|
||||||
$this->width = 2;
|
$this->width = 2;
|
||||||
|
@ -20,7 +20,7 @@ final class HardBreak implements Inline
|
|||||||
* @param int $width
|
* @param int $width
|
||||||
* @param int $position
|
* @param int $position
|
||||||
*/
|
*/
|
||||||
public function __construct($width, $position)
|
private function __construct($width, $position)
|
||||||
{
|
{
|
||||||
$this->width = $width;
|
$this->width = $width;
|
||||||
$this->position = $position;
|
$this->position = $position;
|
||||||
|
@ -24,7 +24,7 @@ final class Image implements Inline
|
|||||||
/**
|
/**
|
||||||
* @param Link $Link
|
* @param Link $Link
|
||||||
*/
|
*/
|
||||||
public function __construct(Link $Link)
|
private function __construct(Link $Link)
|
||||||
{
|
{
|
||||||
$this->Link = $Link;
|
$this->Link = $Link;
|
||||||
$this->width = $Link->width() + 1;
|
$this->width = $Link->width() + 1;
|
||||||
|
@ -35,7 +35,7 @@ final class Link implements Inline
|
|||||||
* @param string|null $title
|
* @param string|null $title
|
||||||
* @param int $width
|
* @param int $width
|
||||||
*/
|
*/
|
||||||
public function __construct($label, $url, $title, $width)
|
private function __construct($label, $url, $title, $width)
|
||||||
{
|
{
|
||||||
$this->label = $label;
|
$this->label = $label;
|
||||||
$this->url = $url;
|
$this->url = $url;
|
||||||
|
@ -23,7 +23,7 @@ final class Markup implements Inline
|
|||||||
/**
|
/**
|
||||||
* @param string $html
|
* @param string $html
|
||||||
*/
|
*/
|
||||||
public function __construct($html)
|
private function __construct($html)
|
||||||
{
|
{
|
||||||
$this->html = $html;
|
$this->html = $html;
|
||||||
$this->width = \strlen($html);
|
$this->width = \strlen($html);
|
||||||
|
@ -18,7 +18,7 @@ final class PlainText implements Inline
|
|||||||
/**
|
/**
|
||||||
* @param string $text
|
* @param string $text
|
||||||
*/
|
*/
|
||||||
public function __construct($text)
|
private function __construct($text)
|
||||||
{
|
{
|
||||||
$this->text = $text;
|
$this->text = $text;
|
||||||
$this->width = \strlen($text);
|
$this->width = \strlen($text);
|
||||||
|
@ -23,7 +23,7 @@ final class SoftBreak implements Inline
|
|||||||
* @param int $width
|
* @param int $width
|
||||||
* @param int $position
|
* @param int $position
|
||||||
*/
|
*/
|
||||||
public function __construct($width, $position)
|
private function __construct($width, $position)
|
||||||
{
|
{
|
||||||
$this->width = $width;
|
$this->width = $width;
|
||||||
$this->position = $position;
|
$this->position = $position;
|
||||||
|
@ -19,7 +19,7 @@ final class SpecialCharacter implements Inline
|
|||||||
/**
|
/**
|
||||||
* @param string $charCodeHtml
|
* @param string $charCodeHtml
|
||||||
*/
|
*/
|
||||||
public function __construct($charCodeHtml)
|
private function __construct($charCodeHtml)
|
||||||
{
|
{
|
||||||
$this->charCodeHtml = $charCodeHtml;
|
$this->charCodeHtml = $charCodeHtml;
|
||||||
$this->width = \strlen($charCodeHtml) + 2;
|
$this->width = \strlen($charCodeHtml) + 2;
|
||||||
|
@ -22,7 +22,7 @@ final class Strikethrough implements Inline
|
|||||||
* @param string $text
|
* @param string $text
|
||||||
* @param int $width
|
* @param int $width
|
||||||
*/
|
*/
|
||||||
public function __construct($text, $width)
|
private function __construct($text, $width)
|
||||||
{
|
{
|
||||||
$this->text = $text;
|
$this->text = $text;
|
||||||
$this->width = $width;
|
$this->width = $width;
|
||||||
|
@ -23,7 +23,7 @@ final class Url implements Inline
|
|||||||
* @param string $url
|
* @param string $url
|
||||||
* @param int $position
|
* @param int $position
|
||||||
*/
|
*/
|
||||||
public function __construct($url, $position)
|
private function __construct($url, $position)
|
||||||
{
|
{
|
||||||
$this->url = $url;
|
$this->url = $url;
|
||||||
$this->width = \strlen($url);
|
$this->width = \strlen($url);
|
||||||
|
@ -20,7 +20,7 @@ final class UrlTag implements Inline
|
|||||||
* @param string $url
|
* @param string $url
|
||||||
* @param int $width
|
* @param int $width
|
||||||
*/
|
*/
|
||||||
public function __construct($url, $width)
|
private function __construct($url, $width)
|
||||||
{
|
{
|
||||||
$this->url = $url;
|
$this->url = $url;
|
||||||
$this->width = $width;
|
$this->width = $width;
|
||||||
|
Loading…
Reference in New Issue
Block a user