Updated MarkdownInteface to use type declarations.

This commit is contained in:
Michel Fortin 2022-09-26 08:01:57 -04:00
parent 932cbc7760
commit 86b59575e7
2 changed files with 4 additions and 4 deletions

View file

@ -29,7 +29,7 @@ class Markdown implements MarkdownInterface {
* @param string $text
* @return string
*/
public static function defaultTransform($text) {
public static function defaultTransform(string $text): string {
// Take parser class on which this function was called.
$parser_class = static::class;
@ -213,7 +213,7 @@ class Markdown implements MarkdownInterface {
* @param string $text
* @return string
*/
public function transform($text) {
public function transform(string $text): string {
$this->setup();
# Remove UTF-8 BOM and marker character in input, if present.

View file

@ -23,7 +23,7 @@ interface MarkdownInterface {
* @param string $text
* @return string
*/
public static function defaultTransform($text);
public static function defaultTransform(string $text): string;
/**
* Main function. Performs some preprocessing on the input text
@ -34,5 +34,5 @@ interface MarkdownInterface {
* @param string $text
* @return string
*/
public function transform($text);
public function transform(string $text): string;
}