-
Notifications
You must be signed in to change notification settings - Fork 30
Update to PHP 8.4 #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
0f009ad
803e158
cd4c2dd
ec93b3c
567a89d
6317532
7f27a4c
286d132
ea7f166
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| <?php declare(strict_types=1); | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Mni\FrontYAML\Bridge\CommonMark; | ||
|
|
||
|
|
@@ -9,17 +11,17 @@ | |
| /** | ||
| * Bridge to the League CommonMark parser | ||
| */ | ||
| class CommonMarkParser implements MarkdownParser | ||
| final class CommonMarkParser implements MarkdownParser | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same please revert |
||
| { | ||
| private MarkdownConverterInterface $parser; | ||
|
|
||
| public function __construct(MarkdownConverterInterface $commonMarkConverter = null) | ||
| public function __construct(MarkdownConverterInterface|null $commonMarkConverter = null) | ||
| { | ||
| $this->parser = $commonMarkConverter ?: new CommonMarkConverter; | ||
| $this->parser = $commonMarkConverter ?: new CommonMarkConverter(); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert |
||
| } | ||
|
|
||
| public function parse(string $markdown): string | ||
| { | ||
| return $this->parser->convertToHtml($markdown)->getContent(); | ||
| return $this->parser?->convertToHtml($markdown)?->getContent() ?? ''; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The parser will never be null |
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't