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

HasTableOfContents   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTableOfContents() 0 3 1
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