Browse Source

Retour de type sur les extensions twig et markdown

Sangfroid 1 month ago
parent
commit
ca6508625b

+ 1 - 1
src/Markdown/Render/ColorRenderer.php

@@ -10,7 +10,7 @@ use League\CommonMark\Util\HtmlElement;
 
 class ColorRenderer implements NodeRendererInterface
 {
-    public function render(Node $node, ChildNodeRendererInterface $childRenderer)
+    public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable|string|null
     {
         if (!($node instanceof ColorText)) {
             throw  new \InvalidArgumentException('Le noeud doit être une instance de ColorText');

+ 1 - 1
src/Markdown/Render/IntroRenderer.php

@@ -10,7 +10,7 @@ use League\CommonMark\Util\HtmlElement;
 
 class IntroRenderer implements NodeRendererInterface
 {
-    public function render(Node $node, ChildNodeRendererInterface $childRenderer)
+    public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable|string|null
     {
         IntroBlock::assertInstanceOf($node);
         /** @var IntroBlock $node */

+ 1 - 1
src/Twig/LastArticles.php

@@ -7,7 +7,7 @@ use Twig\TwigFunction;
 
 class LastArticles extends AbstractExtension
 {
-    public function getFunctions()
+    public function getFunctions(): array
     {
         return [
             new TwigFunction('last_articles', [LastRuntimeExtension::class, 'getLastArticles'])

+ 1 - 1
src/Twig/MarkdownExtension.php

@@ -7,7 +7,7 @@ use Twig\TwigFilter;
 
 class MarkdownExtension extends AbstractExtension
 {
-    public function getFilters()
+    public function getFilters(): array
     {
         return [
             new TwigFilter('markdown', [AppRuntimeExtension::class, 'parse'], ['is_safe' => ['html']])