From 0f6c0fa84d8c919dce1be5f2f5f16195af13d930 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Wed, 5 Dec 2018 15:17:53 +0100 Subject: [PATCH] PHP < 7 compat Don't use token name for function name Remove return typehint Remove parameter typehints --- src/Parsedown.php | 2 +- src/Parsing/Lines.php | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Parsedown.php b/src/Parsedown.php index 4173b5f..6373805 100644 --- a/src/Parsedown.php +++ b/src/Parsedown.php @@ -537,7 +537,7 @@ class Parsedown 'name' => 'li', 'handler' => [ 'function' => 'li', - 'argument' => !empty($matches[3]) ? Lines::fromTextLines($matches[3], 0) : Lines::empty(), + 'argument' => !empty($matches[3]) ? Lines::fromTextLines($matches[3], 0) : Lines::none(), 'destination' => 'elements' ] ]; diff --git a/src/Parsing/Lines.php b/src/Parsing/Lines.php index deaaa07..0c7973b 100644 --- a/src/Parsing/Lines.php +++ b/src/Parsing/Lines.php @@ -40,7 +40,7 @@ final class Lines } /** @return self */ - public static function empty() + public static function none() { return new self([], 0); } @@ -94,7 +94,7 @@ final class Lines } /** @return bool */ - public function containsBlankLines(): bool + public function containsBlankLines() { return $this->containsBlankLines; } @@ -122,8 +122,12 @@ final class Lines return $Lines; } - /** @return Lines */ - public function appendingTextLines(string $text, int $indentOffset) + /** + * @param string $text + * @param int $indentOffset + * @return Lines + */ + public function appendingTextLines($text, $indentOffset) { $Lines = clone($this);