Markdowner::postTransformText()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace App\Services;
4
5
use Michelf\MarkdownExtra;
6
use Michelf\SmartyPants;
7
8
class Markdowner
9
{
10
    /**
11
     * Prepare content to be saved as HTML.
12
     *
13
     * @param string $text
14
     *
15
     * @return string
16
     */
17
    public function toHTML($text)
18
    {
19
        $text = $this->preTransformText($text);
20
        $text = MarkdownExtra::defaultTransform($text);
21
        $text = SmartyPants::defaultTransform($text);
22
        $text = $this->postTransformText($text);
23
24
        return $text;
25
    }
26
27
    /**
28
     * Pre transform text.
29
     *
30
     * @param string
31
     *
32
     * @return string
33
     */
34
    protected function preTransformText($text)
35
    {
36
        return $text;
37
    }
38
39
    /**
40
     * Posts a transform text.
41
     *
42
     * @param string
43
     *
44
     * @return string
45
     */
46
    protected function postTransformText($text)
47
    {
48
        return $text;
49
    }
50
}
51