Skip to content

Commit 50091a0

Browse files
author
roadiz-ci
committed
chore: bumped
1 parent 1fac0dd commit 50091a0

5 files changed

Lines changed: 17 additions & 37 deletions

File tree

.github/workflows/run-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Static analysis and code style
1+
name: Unit tests, static analysis and code style
22

33
on:
44
push:
@@ -15,11 +15,11 @@ on:
1515
- ready_for_review
1616

1717
jobs:
18-
static-analysis-tests:
18+
run-tests:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
php-version: ['8.3', '8.4', '8.5']
22+
php-version: ['8.3', '8.4']
2323
steps:
2424
- uses: shivammathur/setup-php@v2
2525
with:

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"php": ">=8.3",
77
"doctrine/collections": ">=1.6",
88
"league/commonmark": "^2.2.0",
9-
"symfony/stopwatch": "7.4.*",
9+
"symfony/stopwatch": "7.3.*",
1010
"twig/twig": "^3.21"
1111
},
1212
"require-dev": {
13-
"phpstan/phpstan": "^2.1.36",
13+
"phpstan/phpstan": "^1.5.3",
1414
"phpstan/phpdoc-parser": "<2"
1515
},
1616
"license": "MIT",
@@ -29,8 +29,8 @@
2929
},
3030
"extra": {
3131
"branch-alias": {
32-
"dev-master": "2.7.x-dev",
33-
"dev-develop": "2.8.x-dev"
32+
"dev-master": "2.6.x-dev",
33+
"dev-develop": "2.7.x-dev"
3434
}
3535
}
3636
}

src/CommonMark.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,31 @@ public function __construct(
1313
private MarkdownConverter $textConverter,
1414
private MarkdownConverter $textExtraConverter,
1515
private MarkdownConverter $lineConverter,
16-
private MarkdownConverter $textHtmlConverter,
17-
private MarkdownConverter $textExtraHtmlConverter,
1816
private ?Stopwatch $stopwatch = null,
1917
) {
2018
}
2119

2220
#[\Override]
23-
public function text(?string $markdown = null, bool $allowHtml = false): string
21+
public function text(?string $markdown = null): string
2422
{
2523
if (null === $markdown) {
2624
return '';
2725
}
2826
$this->stopwatch?->start(CommonMark::class.'::text');
29-
$converter = $allowHtml ? $this->textHtmlConverter : $this->textConverter;
30-
$html = $converter->convert($markdown)->getContent();
27+
$html = $this->textConverter->convert($markdown)->getContent();
3128
$this->stopwatch?->stop(CommonMark::class.'::text');
3229

3330
return $html;
3431
}
3532

3633
#[\Override]
37-
public function textExtra(?string $markdown = null, bool $allowHtml = false): string
34+
public function textExtra(?string $markdown = null): string
3835
{
3936
if (null === $markdown) {
4037
return '';
4138
}
4239
$this->stopwatch?->start(CommonMark::class.'::textExtra');
43-
$converter = $allowHtml ? $this->textExtraHtmlConverter : $this->textExtraConverter;
44-
$html = $converter->convert($markdown)->getContent();
40+
$html = $this->textExtraConverter->convert($markdown)->getContent();
4541
$this->stopwatch?->stop(CommonMark::class.'::textExtra');
4642

4743
return $html;

src/MarkdownInterface.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@ interface MarkdownInterface
88
{
99
/**
1010
* Convert Markdown to HTML using standard Markdown syntax.
11-
*
12-
* @param bool $allowHtml Pass true to allow raw HTML (including script/style tags) through
13-
* unchanged. Defaults to false (raw HTML is stripped).
1411
*/
15-
public function text(?string $markdown = null, bool $allowHtml = false): string;
12+
public function text(?string $markdown = null): string;
1613

1714
/**
1815
* Convert Markdown to HTML using standard Markdown Extra syntax.
19-
*
20-
* @param bool $allowHtml Pass true to allow raw HTML (including script/style tags) through
21-
* unchanged. Defaults to false (raw HTML is stripped).
2216
*/
23-
public function textExtra(?string $markdown = null, bool $allowHtml = false): string;
17+
public function textExtra(?string $markdown = null): string;
2418

2519
/**
2620
* Convert Markdown to HTML using only inline HTML elements.

src/Twig/MarkdownExtension.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,13 @@ public function getFilters(): array
2626
];
2727
}
2828

29-
/**
30-
* @param bool $allowHtml Set to true to allow raw HTML (including script/style tags) through
31-
* unchanged. Defaults to false — raw HTML is stripped.
32-
* Usage: {{ content|markdown(true) }}
33-
*/
34-
public function markdown(?string $input, bool $allowHtml = false): string
29+
public function markdown(?string $input): string
3530
{
3631
if (null === $input) {
3732
return '';
3833
}
3934

40-
return $this->markdown->text($input, $allowHtml);
35+
return $this->markdown->text($input);
4136
}
4237

4338
public function inlineMarkdown(?string $input): string
@@ -49,17 +44,12 @@ public function inlineMarkdown(?string $input): string
4944
return $this->markdown->line($input);
5045
}
5146

52-
/**
53-
* @param bool $allowHtml Set to true to allow raw HTML (including script/style tags) through
54-
* unchanged. Defaults to false — raw HTML is stripped.
55-
* Usage: {{ content|markdownExtra(true) }}
56-
*/
57-
public function markdownExtra(?string $input, bool $allowHtml = false): string
47+
public function markdownExtra(?string $input): string
5848
{
5949
if (null === $input) {
6050
return '';
6151
}
6252

63-
return $this->markdown->textExtra($input, $allowHtml);
53+
return $this->markdown->textExtra($input);
6454
}
6555
}

0 commit comments

Comments
 (0)