Skip to content

Commit 10ee31b

Browse files
authored
Merge pull request #24 from retailcrm/twig-deprecates
fix twig deprecates
2 parents a896abb + 6946e8b commit 10ee31b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Twig/Extension/MarkdownExtension.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,30 @@
44

55
use Michelf\MarkdownExtra;
66
use Twig\Extension\AbstractExtension;
7+
use Twig\TwigFilter;
78

89
class MarkdownExtension extends AbstractExtension
910
{
10-
protected $markdownParser;
11+
private MarkdownExtra $markdownParser;
1112

1213
public function __construct()
1314
{
1415
$this->markdownParser = new MarkdownExtra();
1516
}
1617

17-
public function getFilters()
18+
public function getFilters(): array
1819
{
1920
return [
20-
new \Twig\TwigFilter('extra_markdown', [$this, 'markdown'], ['is_safe' => ['html']]),
21+
new TwigFilter('extra_markdown', [$this, 'markdown'], ['is_safe' => ['html']]),
2122
];
2223
}
2324

24-
public function getName()
25+
public function getName(): string
2526
{
2627
return 'nelmio_api_doc';
2728
}
2829

29-
public function markdown($text)
30+
public function markdown($text): string
3031
{
3132
return $this->markdownParser->transform($text);
3233
}

0 commit comments

Comments
 (0)