Skip to content

Commit 86b5957

Browse files
committed
Updated MarkdownInteface to use type declarations.
1 parent 932cbc7 commit 86b5957

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Michelf/Markdown.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Markdown implements MarkdownInterface {
2929
* @param string $text
3030
* @return string
3131
*/
32-
public static function defaultTransform($text) {
32+
public static function defaultTransform(string $text): string {
3333
// Take parser class on which this function was called.
3434
$parser_class = static::class;
3535

@@ -213,7 +213,7 @@ protected function teardown() {
213213
* @param string $text
214214
* @return string
215215
*/
216-
public function transform($text) {
216+
public function transform(string $text): string {
217217
$this->setup();
218218

219219
# Remove UTF-8 BOM and marker character in input, if present.

Michelf/MarkdownInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface MarkdownInterface {
2323
* @param string $text
2424
* @return string
2525
*/
26-
public static function defaultTransform($text);
26+
public static function defaultTransform(string $text): string;
2727

2828
/**
2929
* Main function. Performs some preprocessing on the input text
@@ -34,5 +34,5 @@ public static function defaultTransform($text);
3434
* @param string $text
3535
* @return string
3636
*/
37-
public function transform($text);
37+
public function transform(string $text): string;
3838
}

0 commit comments

Comments
 (0)