Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function parse(InlineParserContext $inlineContext): bool |
||
19 | { |
||
20 | $route = $inlineContext->getFullMatch(); |
||
21 | |||
22 | // Push the cursor to the lenght of the full match. |
||
23 | $inlineContext->getCursor()->advanceBy(\strlen($route)); |
||
24 | |||
25 | $commit = substr($inlineContext->getMatches()[3], 0, 7); |
||
26 | |||
27 | $content = "{$inlineContext->getMatches()[1]}@{$commit}"; |
||
28 | |||
29 | |||
30 | $inlineContext->getContainer() |
||
31 | ->appendChild(new GithubCommit( |
||
32 | $content, |
||
33 | [ |
||
34 | 'attributes' => [ |
||
35 | 'href' => $route, |
||
36 | 'data-toggle' => 'tooltip', |
||
37 | 'title' => $content |
||
38 | ] |
||
39 | ] |
||
40 | )); |
||
41 | |||
42 | return true; |
||
43 | } |
||
45 |