diff --git a/src/Renderer/Block/HtmlBlockRenderer.php b/src/Renderer/Block/HtmlBlockRenderer.php
index e5d2b01..bf4e3b8 100644
--- a/src/Renderer/Block/HtmlBlockRenderer.php
+++ b/src/Renderer/Block/HtmlBlockRenderer.php
@@ -30,6 +30,7 @@ public function render(Node $node, ChildNodeRendererInterface $childRenderer): s
// We ignore $node->getType() here, as we want to render all HTML blocks the same way.
+ /** @var string $htmlInput */
$htmlInput = $this->config->get('html_input');
return HtmlFilter::filter($node->getLiteral(), $htmlInput);
diff --git a/src/Renderer/Inline/HtmlInlineRenderer.php b/src/Renderer/Inline/HtmlInlineRenderer.php
index 669fd7d..b2e4f30 100644
--- a/src/Renderer/Inline/HtmlInlineRenderer.php
+++ b/src/Renderer/Inline/HtmlInlineRenderer.php
@@ -28,6 +28,7 @@ public function render(Node $node, ChildNodeRendererInterface $childRenderer): s
{
HtmlInline::assertInstanceOf($node);
+ /** @var string $htmlInput */
$htmlInput = $this->config->get('html_input');
return HtmlFilter::filter($node->getLiteral(), $htmlInput);
diff --git a/src/Renderer/Inline/ImageRenderer.php b/src/Renderer/Inline/ImageRenderer.php
index e6c187e..25eb3d3 100644
--- a/src/Renderer/Inline/ImageRenderer.php
+++ b/src/Renderer/Inline/ImageRenderer.php
@@ -28,6 +28,7 @@ public function render(Node $node, ChildNodeRendererInterface $childRenderer): s
{
Image::assertInstanceOf($node);
+ /** @var array $attrs */
$attrs = $node->data->get('attributes');
$forbidUnsafeLinks = ! $this->config->get('allow_unsafe_links');
diff --git a/src/Renderer/Inline/LinkRenderer.php b/src/Renderer/Inline/LinkRenderer.php
index b6e44c7..4551ed4 100644
--- a/src/Renderer/Inline/LinkRenderer.php
+++ b/src/Renderer/Inline/LinkRenderer.php
@@ -28,6 +28,7 @@ public function render(Node $node, ChildNodeRendererInterface $childRenderer): s
{
Link::assertInstanceOf($node);
+ /** @var array $attrs */
$attrs = $node->data->get('attributes');
$forbidUnsafeLinks = ! $this->config->get('allow_unsafe_links');
diff --git a/src/Renderer/Inline/NewlineRenderer.php b/src/Renderer/Inline/NewlineRenderer.php
index 256253a..c6b38da 100644
--- a/src/Renderer/Inline/NewlineRenderer.php
+++ b/src/Renderer/Inline/NewlineRenderer.php
@@ -35,6 +35,7 @@ public function render(Node $node, ChildNodeRendererInterface $childRenderer): s
return "\n";
}
+ /** @phpstan-var string */
return $this->config->get('renderer/soft_break');
}
}
diff --git a/src/Renderer/MarkdownRenderer.php b/src/Renderer/MarkdownRenderer.php
index 0fa3ec6..d0968fd 100644
--- a/src/Renderer/MarkdownRenderer.php
+++ b/src/Renderer/MarkdownRenderer.php
@@ -75,11 +75,13 @@ public function renderNodes(iterable $nodes): string
public function getBlockSeparator(): string
{
+ /** @phpstan-var string */
return $this->environment->getConfiguration()->get('renderer/block_separator');
}
public function getInnerSeparator(): string
{
+ /** @phpstan-var string */
return $this->environment->getConfiguration()->get('renderer/inner_separator');
}
}
diff --git a/tests/MarkdownRendererExtensionTest.php b/tests/MarkdownRendererExtensionTest.php
index ad28fd9..869a86d 100644
--- a/tests/MarkdownRendererExtensionTest.php
+++ b/tests/MarkdownRendererExtensionTest.php
@@ -29,7 +29,7 @@ public function test_markdown_renderer_extension_works(string $markdown, array $
}
/**
- * @return iterable>
+ * @return \Iterator
*/
public static function getTestData(): \Iterator
{
diff --git a/tests/Renderer/Block/FencedCodeRendererTest.php b/tests/Renderer/Block/FencedCodeRendererTest.php
index 2b1087a..9f26166 100644
--- a/tests/Renderer/Block/FencedCodeRendererTest.php
+++ b/tests/Renderer/Block/FencedCodeRendererTest.php
@@ -21,6 +21,9 @@ protected function setUp(): void
$this->renderer = new FencedCodeRenderer();
}
+ /**
+ * @param array $fencedArgs
+ */
#[Test]
#[DataProvider('provide_fenced_code')]
public function it_renders_fenced_code(array $fencedArgs, string $expected): void
@@ -41,6 +44,9 @@ public function it_renders_fenced_code(array $fencedArgs, string $expected): voi
$this->assertEquals($expected, $result);
}
+ /**
+ * @return array|string>>
+ */
public function provide_fenced_code(): array
{
return [
diff --git a/tests/Renderer/MarkdownRendererTest.php b/tests/Renderer/MarkdownRendererTest.php
index d905698..ecae7f8 100644
--- a/tests/Renderer/MarkdownRendererTest.php
+++ b/tests/Renderer/MarkdownRendererTest.php
@@ -40,6 +40,7 @@ public function it_renders_ast_to_markdown(): void
#[Test]
public function it_parses_and_renders_kitchen_sink(): void
{
+ /** @var string $contentKitchenSink */
$contentKitchenSink = file_get_contents(__DIR__ . '/../stubs/kitchen-sink.md');
$contentKitchenSinkExpected = file_get_contents(__DIR__ . '/../stubs/kitchen-sink-expected.md');
@@ -53,6 +54,7 @@ public function it_parses_and_renders_kitchen_sink(): void
#[Test]
public function it_parses_kitchen_sink_and_parsing_the_result_again_returns_the_same_result(): void
{
+ /** @var string $contentKitchenSink */
$contentKitchenSink = file_get_contents(__DIR__ . '/../stubs/kitchen-sink.md');
$contentKitchenSinkExpected = file_get_contents(__DIR__ . '/../stubs/kitchen-sink-expected.md');