Conditions | 3 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
23 | public function processInlines(DelimiterStack $delimiterStack, Delimiter $stackBottom = null) |
||
24 | { |
||
25 | 45 | $callback = function (Delimiter $opener, Delimiter $closer) { |
|
26 | // Open quote |
||
27 | 24 | $openerInline = $opener->getInlineNode(); |
|
28 | 24 | $openerInline->setContent( |
|
29 | 24 | $openerInline->getContent() === '“' ? '“' : '‘' |
|
30 | 24 | ); |
|
31 | |||
32 | // Close quote |
||
33 | 24 | $closerInline = $closer->getInlineNode(); |
|
34 | 24 | $closerInline->setContent( |
|
35 | 24 | $closerInline->getContent() === '“' ? '”' : '’' |
|
36 | 24 | ); |
|
37 | |||
38 | 24 | return $closer->getNext(); |
|
39 | 45 | }; |
|
40 | |||
41 | // Process the emphasis characters |
||
42 | 45 | $delimiterStack->iterateByCharacters(['“', '’'], $callback, $stackBottom); |
|
43 | 45 | } |
|
44 | } |
||
45 |