Passed
Push — master ( ea6259...fd9feb )
by Caen
03:52 queued 11s
created

HasTableOfContents::constructTableOfContents()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Hyde\Framework\Concerns;
4
5
use Hyde\Framework\Actions\GeneratesSidebarTableOfContents;
6
7
/**
8
 * Generate Table of Contents as HTML from a Markdown document body.
9
 *
10
 * Intended to be used for documentation pages.
11
 *
12
 * @see \Hyde\Framework\Testing\Unit\HasTableOfContentsTest
13
 */
14
trait HasTableOfContents
15
{
16
    public function getTableOfContents(): string
17
    {
18
        return (new GeneratesSidebarTableOfContents($this->body))->execute();
19
    }
20
}
21