1
0
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:
Aidan Woods 2019-02-16 12:37:22 +00:00
parent f83ee87902
commit 3c0b528d54
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
24 changed files with 27 additions and 23 deletions

View File

@ -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;
} }

View File

@ -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;

View File

@ -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;

View File

@ -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;
} }

View File

@ -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;
} }

View File

@ -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;
} }

View File

@ -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

View File

@ -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;

View File

@ -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,

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;