aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php')
-rw-r--r--vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php b/vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php
index eb2d09d17..65034db12 100644
--- a/vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php
+++ b/vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php
@@ -1,32 +1,30 @@
<?php
+declare(strict_types=1);
+
namespace League\HTMLToMarkdown\Converter;
use League\HTMLToMarkdown\ElementInterface;
class BlockquoteConverter implements ConverterInterface
{
- /**
- * @param ElementInterface $element
- *
- * @return string
- */
- public function convert(ElementInterface $element)
+ public function convert(ElementInterface $element): string
{
// Contents should have already been converted to Markdown by this point,
// so we just need to add '>' symbols to each line.
$markdown = '';
- $quote_content = trim($element->getValue());
+ $quoteContent = \trim($element->getValue());
- $lines = preg_split('/\r\n|\r|\n/', $quote_content);
+ $lines = \preg_split('/\r\n|\r|\n/', $quoteContent);
+ \assert(\is_array($lines));
- $total_lines = count($lines);
+ $totalLines = \count($lines);
foreach ($lines as $i => $line) {
$markdown .= '> ' . $line . "\n";
- if ($i + 1 === $total_lines) {
+ if ($i + 1 === $totalLines) {
$markdown .= "\n";
}
}
@@ -37,8 +35,8 @@ class BlockquoteConverter implements ConverterInterface
/**
* @return string[]
*/
- public function getSupportedTags()
+ public function getSupportedTags(): array
{
- return array('blockquote');
+ return ['blockquote'];
}
}