Skip to content
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

Highlight nested PHP comments #180

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ public function parserUnitBlockProvider()
'blockName' => 'code-blocks/php-attributes',
];

yield 'code-block-php-nested-comments' => [
'blockName' => 'code-blocks/php-nested-comments',
];

yield 'code-block-text' => [
'blockName' => 'code-blocks/text',
];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<p>You can do that by adding a "stamp" to your message:</p>
<div translate="no" data-loc="10" class="notranslate codeblock codeblock-length-md codeblock-php">
<div class="codeblock-scroll">
<pre class="codeblock-lines">1
2
3
4
5
6
7
8
9
10</pre>
<pre class="codeblock-code">
<code>
<span class="hljs-keyword">use</span>
<span class="hljs-title">Symfony</span>
\
<span class="hljs-title">Component</span>
\
<span class="hljs-title">Messenger</span>
\
<span class="hljs-title">MessageBusInterface</span>
;
<span class="hljs-keyword">use</span>
<span class="hljs-title">Symfony</span>
\
<span class="hljs-title">Component</span>
\
<span class="hljs-title">Messenger</span>
\
<span class="hljs-title">Stamp</span>
\
<span class="hljs-title">DelayStamp</span>
;
<span class="hljs-keyword">public</span>
<span class="hljs-function">
<span class="hljs-keyword">function</span>
<span class="hljs-title">index</span>
<span class="hljs-params">
(MessageBusInterface
<span class="hljs-variable">
<span class="hljs-variable-other-marker">$</span>
bus
</span>
)
</span>
</span>
{
<span class="hljs-variable">
<span class="hljs-variable-other-marker">$</span>
bus
</span>
-&gt;
<span class="hljs-title invoke__">dispatch</span>
(
<span class="hljs-keyword">new</span>
<span class="hljs-title invoke__">SmsNotification</span>
(
<span class="hljs-string">'...'</span>
), [
<span class="hljs-comment">// wait 5 seconds before processing</span>
<span class="hljs-keyword">new</span>
<span class="hljs-title invoke__">DelayStamp</span>
(
<span class="hljs-number">5000</span>
), ]);
}
</code>
</pre>
</div>
</div>
12 changes: 12 additions & 0 deletions tests/fixtures/source/blocks/code-blocks/php-nested-comments.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
You can do that by adding a "stamp" to your message::

use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Messenger\Stamp\DelayStamp;

public function index(MessageBusInterface $bus)
{
$bus->dispatch(new SmsNotification('...'), [
// wait 5 seconds before processing
new DelayStamp(5000),
]);
}
Loading