Completed
Push — master ( fb455c...75e31d )
by ARCANEDEV
06:38
created

helpers.php ➔ markdown()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
if ( ! function_exists('markdown')) {
4
    /**
5
     * Helper function to parse a markdown string to HTML or return the parser instance if the content is null.
6
     *
7
     * @param  string  $content
8
     *
9
     * @return \Arcanedev\LaravelMarkdown\Contracts\Parser|string
10
     */
11
    function markdown($content = null) {
12
        $markdown = app(Arcanedev\LaravelMarkdown\Contracts\Parser::class);
13
14
        return is_null($content) ? $markdown : $markdown->parse($content);
15
    }
16
}
17