mvc_modules()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 6
ccs 0
cts 3
cp 0
crap 6
rs 10
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * @return \Nip\Mvc\Modules
5
 */
6
function mvc_modules()
7
{
8
    if (!function_exists('app')) {
9
        return null;
10
    }
11
    return app('mvc.modules');
12
}
13
14
/**
15
 * @return \Nip\Mvc\Sections\SectionsManager
16
 */
17
function mvc_sections()
18
{
19
    if (!function_exists('app')) {
20
        return null;
21
    }
22
    return app('mvc.sections');
23
}
24
25
/**
26
 * @param $section
27
 * @param $url
28
 * @return string
29
 */
30
function mvc_section_url($section, $url = false): string
31
{
32
    $section = mvc_sections()->getOne($section);
33
    return $section->getURL($url);
34
}
35