Passed
Push — master ( 9d353c...b7a2a8 )
by Caen
03:28
created

markdown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace {
6
    use Hyde\Foundation\HydeKernel;
7
8
    if (! function_exists('hyde')) {
9
        /**
10
         * Get the available HydeKernel instance.
11
         */
12
        function hyde(): HydeKernel
13
        {
14
            return app(HydeKernel::class);
15
        }
16
    }
17
18
    if (! function_exists('unslash')) {
19
        /**
20
         * Remove trailing slashes from the start and end of a string.
21
         */
22
        function unslash(string $string): string
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
23
        {
24
            return trim($string, '/\\');
25
        }
26
    }
27
}
28
29
namespace Hyde {
30
    use Hyde\Foundation\HydeKernel;
31
32
    if (! function_exists('\Hyde\hyde')) {
33
        /**
34
         * Get the available HydeKernel instance.
35
         */
36
        function hyde(): HydeKernel
37
        {
38
            return app(HydeKernel::class);
39
        }
40
    }
41
42
    if (! function_exists('\Hyde\unslash')) {
43
        /**
44
         * Remove trailing slashes from the start and end of a string.
45
         */
46
        function unslash(string $string): string
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
47
        {
48
            return trim($string, '/\\');
49
        }
50
    }
51
52
    if (! function_exists('\Hyde\make_title')) {
53
        function make_title(string $value): string
54
        {
55
            return hyde()->makeTitle($value);
56
        }
57
    }
58
59
    if (! function_exists('\Hyde\normalize_newlines')) {
60
        function normalize_newlines(string $string): string
61
        {
62
            return hyde()->normalizeNewlines($string);
63
        }
64
    }
65
66
    if (! function_exists('\Hyde\strip_newlines')) {
67
        function strip_newlines(string $string): string
68
        {
69
            return hyde()->stripNewlines($string);
70
        }
71
    }
72
73
    if (! function_exists('\Hyde\trim_slashes')) {
74
        function trim_slashes(string $string): string
75
        {
76
            return hyde()->trimSlashes($string);
77
        }
78
    }
79
}
80