Passed
Push — master ( 049c92...563669 )
by 世昌
02:14
created

ModuleTemplateCommand::parseE()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 4
rs 10
1
<?php
2
namespace suda\application\template;
3
4
use suda\application\template\compiler\Command;
5
6
/**
7
 * Class ModuleTemplateCommand
8
 * @package suda\application\template
9
 */
10
class ModuleTemplateCommand extends Command
11
{
12
    /**
13
     * @param string $data
14
     * @return string
15
     */
16
    protected function parseU(string $data)
17
    {
18
        if (strlen(trim($data)) === 0) {
19
            return '<?php echo $this->getUrl(); ?>';
20
        }
21
        return '<?php echo $this->getUrl'.$data.'; ?>';
22
    }
23
24
    /**
25
     * @param $content
26
     * @return string
27
     */
28
    protected function parseStatic($content)
29
    {
30
        $content = strlen(trim($content)) === 0 ?'()':$content;
31
        return '<?php echo $this->getStaticModulePrefix'.$content.'; ?>';
32
    }
33
34
    /**
35
     * @param $content
36
     * @return string
37
     */
38
    protected function parseE($content)
39
    {
40
        $content = strlen(trim($content)) === 0 ?'()':$content;
41
        return '<?php echo $this->application->_'.$content.'; ?>';
42
    }
43
}
44