From 3c0b528d54726d03ae1c3221c8a4023eee766380 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Sat, 16 Feb 2019 12:37:22 +0000 Subject: [PATCH] Constructor shouldn't be part of public API --- src/Components/Blocks/BlockQuote.php | 2 +- src/Components/Blocks/FencedCode.php | 2 +- src/Components/Blocks/Header.php | 2 +- src/Components/Blocks/IndentedCode.php | 2 +- src/Components/Blocks/Paragraph.php | 2 +- src/Components/Blocks/Reference.php | 2 +- src/Components/Blocks/Rule.php | 4 ++++ src/Components/Blocks/SetextHeader.php | 2 +- src/Components/Blocks/TList.php | 2 +- src/Components/Blocks/Table.php | 2 +- src/Components/Inlines/Code.php | 2 +- src/Components/Inlines/Email.php | 2 +- src/Components/Inlines/Emphasis.php | 2 +- src/Components/Inlines/EscapeSequence.php | 2 +- src/Components/Inlines/HardBreak.php | 2 +- src/Components/Inlines/Image.php | 2 +- src/Components/Inlines/Link.php | 2 +- src/Components/Inlines/Markup.php | 2 +- src/Components/Inlines/PlainText.php | 2 +- src/Components/Inlines/SoftBreak.php | 2 +- src/Components/Inlines/SpecialCharacter.php | 2 +- src/Components/Inlines/Strikethrough.php | 2 +- src/Components/Inlines/Url.php | 2 +- src/Components/Inlines/UrlTag.php | 2 +- 24 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/Components/Blocks/BlockQuote.php b/src/Components/Blocks/BlockQuote.php index 8aa6597..0996ab7 100644 --- a/src/Components/Blocks/BlockQuote.php +++ b/src/Components/Blocks/BlockQuote.php @@ -22,7 +22,7 @@ final class BlockQuote implements ContinuableBlock /** * @param Lines $Lines */ - public function __construct($Lines) + private function __construct($Lines) { $this->Lines = $Lines; } diff --git a/src/Components/Blocks/FencedCode.php b/src/Components/Blocks/FencedCode.php index 1dca837..544fa20 100644 --- a/src/Components/Blocks/FencedCode.php +++ b/src/Components/Blocks/FencedCode.php @@ -34,7 +34,7 @@ final class FencedCode implements ContinuableBlock * @param int $openerLength * @param bool $isComplete */ - public function __construct($code, $infostring, $marker, $openerLength, $isComplete) + private function __construct($code, $infostring, $marker, $openerLength, $isComplete) { $this->code = $code; $this->infostring = $infostring; diff --git a/src/Components/Blocks/Header.php b/src/Components/Blocks/Header.php index 80190d7..e32c9e3 100644 --- a/src/Components/Blocks/Header.php +++ b/src/Components/Blocks/Header.php @@ -23,7 +23,7 @@ final class Header implements Block * @param string $text * @param 1|2|3|4|5|6 $level */ - public function __construct($text, $level) + private function __construct($text, $level) { $this->text = $text; $this->level = $level; diff --git a/src/Components/Blocks/IndentedCode.php b/src/Components/Blocks/IndentedCode.php index 75debe3..7c0d7ad 100644 --- a/src/Components/Blocks/IndentedCode.php +++ b/src/Components/Blocks/IndentedCode.php @@ -19,7 +19,7 @@ final class IndentedCode implements ContinuableBlock /** * @param string $code */ - public function __construct($code) + private function __construct($code) { $this->code = $code; } diff --git a/src/Components/Blocks/Paragraph.php b/src/Components/Blocks/Paragraph.php index 9656743..f4e1686 100644 --- a/src/Components/Blocks/Paragraph.php +++ b/src/Components/Blocks/Paragraph.php @@ -19,7 +19,7 @@ final class Paragraph implements ContinuableBlock /** * @param string $text */ - public function __construct($text) + private function __construct($text) { $this->text = $text; } diff --git a/src/Components/Blocks/Reference.php b/src/Components/Blocks/Reference.php index 3c4ec18..ef0a560 100644 --- a/src/Components/Blocks/Reference.php +++ b/src/Components/Blocks/Reference.php @@ -15,7 +15,7 @@ final class Reference implements StateUpdatingBlock /** @var State */ private $State; - public function __construct(State $State) + private function __construct(State $State) { $this->State = $State; } diff --git a/src/Components/Blocks/Rule.php b/src/Components/Blocks/Rule.php index 3dcd100..a1a29e7 100644 --- a/src/Components/Blocks/Rule.php +++ b/src/Components/Blocks/Rule.php @@ -10,6 +10,10 @@ use Erusev\Parsedown\State; final class Rule implements Block { + private function __construct() + { + } + /** * @param Context $Context * @param State $State diff --git a/src/Components/Blocks/SetextHeader.php b/src/Components/Blocks/SetextHeader.php index d1365b2..a07e926 100644 --- a/src/Components/Blocks/SetextHeader.php +++ b/src/Components/Blocks/SetextHeader.php @@ -23,7 +23,7 @@ final class SetextHeader implements AcquisitioningBlock * @param string $text * @param 1|2 $level */ - public function __construct($text, $level) + private function __construct($text, $level) { $this->text = $text; $this->level = $level; diff --git a/src/Components/Blocks/TList.php b/src/Components/Blocks/TList.php index 25d17ab..0589a58 100644 --- a/src/Components/Blocks/TList.php +++ b/src/Components/Blocks/TList.php @@ -53,7 +53,7 @@ final class TList implements ContinuableBlock * @param string $markerType * @param string $markerTypeRegex */ - public function __construct( + private function __construct( $Lis, $listStart, $isLoose, diff --git a/src/Components/Blocks/Table.php b/src/Components/Blocks/Table.php index ed47417..793f30c 100644 --- a/src/Components/Blocks/Table.php +++ b/src/Components/Blocks/Table.php @@ -35,7 +35,7 @@ final class Table implements AcquisitioningBlock, ContinuableBlock * @param array> $rows * @param bool $acquired */ - public function __construct($alignments, $headerCells, $rows, $acquired = false) + private function __construct($alignments, $headerCells, $rows, $acquired = false) { $this->alignments = $alignments; $this->headerCells = $headerCells; diff --git a/src/Components/Inlines/Code.php b/src/Components/Inlines/Code.php index 85e20f2..0daf84c 100644 --- a/src/Components/Inlines/Code.php +++ b/src/Components/Inlines/Code.php @@ -20,7 +20,7 @@ final class Code implements Inline * @param string $text * @param int $width */ - public function __construct($text, $width) + private function __construct($text, $width) { $this->text = $text; $this->width = $width; diff --git a/src/Components/Inlines/Email.php b/src/Components/Inlines/Email.php index 2880da7..a27dbfb 100644 --- a/src/Components/Inlines/Email.php +++ b/src/Components/Inlines/Email.php @@ -24,7 +24,7 @@ final class Email implements Inline * @param string $url * @param int $width */ - public function __construct($text, $url, $width) + private function __construct($text, $url, $width) { $this->text = $text; $this->url = $url; diff --git a/src/Components/Inlines/Emphasis.php b/src/Components/Inlines/Emphasis.php index 4ed1c8c..6e4a9ec 100644 --- a/src/Components/Inlines/Emphasis.php +++ b/src/Components/Inlines/Emphasis.php @@ -38,7 +38,7 @@ final class Emphasis implements Inline * @param 'em'|'strong' $type * @param int $width */ - public function __construct($text, $type, $width) + private function __construct($text, $type, $width) { $this->text = $text; $this->type = $type; diff --git a/src/Components/Inlines/EscapeSequence.php b/src/Components/Inlines/EscapeSequence.php index 369b71c..7f45290 100644 --- a/src/Components/Inlines/EscapeSequence.php +++ b/src/Components/Inlines/EscapeSequence.php @@ -20,7 +20,7 @@ final class EscapeSequence implements Inline /** * @param string $text */ - public function __construct($text) + private function __construct($text) { $this->text = $text; $this->width = 2; diff --git a/src/Components/Inlines/HardBreak.php b/src/Components/Inlines/HardBreak.php index 416373c..a652e33 100644 --- a/src/Components/Inlines/HardBreak.php +++ b/src/Components/Inlines/HardBreak.php @@ -20,7 +20,7 @@ final class HardBreak implements Inline * @param int $width * @param int $position */ - public function __construct($width, $position) + private function __construct($width, $position) { $this->width = $width; $this->position = $position; diff --git a/src/Components/Inlines/Image.php b/src/Components/Inlines/Image.php index e8a7606..88ce4b6 100644 --- a/src/Components/Inlines/Image.php +++ b/src/Components/Inlines/Image.php @@ -24,7 +24,7 @@ final class Image implements Inline /** * @param Link $Link */ - public function __construct(Link $Link) + private function __construct(Link $Link) { $this->Link = $Link; $this->width = $Link->width() + 1; diff --git a/src/Components/Inlines/Link.php b/src/Components/Inlines/Link.php index 76978de..858e083 100644 --- a/src/Components/Inlines/Link.php +++ b/src/Components/Inlines/Link.php @@ -35,7 +35,7 @@ final class Link implements Inline * @param string|null $title * @param int $width */ - public function __construct($label, $url, $title, $width) + private function __construct($label, $url, $title, $width) { $this->label = $label; $this->url = $url; diff --git a/src/Components/Inlines/Markup.php b/src/Components/Inlines/Markup.php index aa0334e..59a8363 100644 --- a/src/Components/Inlines/Markup.php +++ b/src/Components/Inlines/Markup.php @@ -23,7 +23,7 @@ final class Markup implements Inline /** * @param string $html */ - public function __construct($html) + private function __construct($html) { $this->html = $html; $this->width = \strlen($html); diff --git a/src/Components/Inlines/PlainText.php b/src/Components/Inlines/PlainText.php index ddc3b14..dee1070 100644 --- a/src/Components/Inlines/PlainText.php +++ b/src/Components/Inlines/PlainText.php @@ -18,7 +18,7 @@ final class PlainText implements Inline /** * @param string $text */ - public function __construct($text) + private function __construct($text) { $this->text = $text; $this->width = \strlen($text); diff --git a/src/Components/Inlines/SoftBreak.php b/src/Components/Inlines/SoftBreak.php index 11d36f2..ccacd45 100644 --- a/src/Components/Inlines/SoftBreak.php +++ b/src/Components/Inlines/SoftBreak.php @@ -23,7 +23,7 @@ final class SoftBreak implements Inline * @param int $width * @param int $position */ - public function __construct($width, $position) + private function __construct($width, $position) { $this->width = $width; $this->position = $position; diff --git a/src/Components/Inlines/SpecialCharacter.php b/src/Components/Inlines/SpecialCharacter.php index be75a64..0c95c25 100644 --- a/src/Components/Inlines/SpecialCharacter.php +++ b/src/Components/Inlines/SpecialCharacter.php @@ -19,7 +19,7 @@ final class SpecialCharacter implements Inline /** * @param string $charCodeHtml */ - public function __construct($charCodeHtml) + private function __construct($charCodeHtml) { $this->charCodeHtml = $charCodeHtml; $this->width = \strlen($charCodeHtml) + 2; diff --git a/src/Components/Inlines/Strikethrough.php b/src/Components/Inlines/Strikethrough.php index 3f8dab6..669188a 100644 --- a/src/Components/Inlines/Strikethrough.php +++ b/src/Components/Inlines/Strikethrough.php @@ -22,7 +22,7 @@ final class Strikethrough implements Inline * @param string $text * @param int $width */ - public function __construct($text, $width) + private function __construct($text, $width) { $this->text = $text; $this->width = $width; diff --git a/src/Components/Inlines/Url.php b/src/Components/Inlines/Url.php index b4f5a44..3b7f1fd 100644 --- a/src/Components/Inlines/Url.php +++ b/src/Components/Inlines/Url.php @@ -23,7 +23,7 @@ final class Url implements Inline * @param string $url * @param int $position */ - public function __construct($url, $position) + private function __construct($url, $position) { $this->url = $url; $this->width = \strlen($url); diff --git a/src/Components/Inlines/UrlTag.php b/src/Components/Inlines/UrlTag.php index 06f0d08..20ec397 100644 --- a/src/Components/Inlines/UrlTag.php +++ b/src/Components/Inlines/UrlTag.php @@ -20,7 +20,7 @@ final class UrlTag implements Inline * @param string $url * @param int $width */ - public function __construct($url, $width) + private function __construct($url, $width) { $this->url = $url; $this->width = $width;