Completed
Push — master ( 8aac33...fe291a )
by Park Jong-Hun
02:40
created

Welcome   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 18
rs 10
c 1
b 0
f 0
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A index() 0 11 1
1
<?php
2
3
namespace App\Controller\Admin;
4
5
use Core\Application;
6
use Core\ViewModel;
7
8
class Welcome {
9
    public function __construct(ViewModel $view, $urlPattern)
10
    {
11
        $view->set('nav', $urlPattern);
12
    }
13
14
    public function index(ViewModel $view) {
15
        $view->set('siteUrl', Application::getUrl());
16
        $view->set('sitePublicUrl', Application::getPublicUrl());
17
18
        $view->set('absolutePath', realpath(__DIR__ . '/../../'));
19
        $view->set('phpVersion', PHP_VERSION);
20
        $view->set('os', PHP_OS);
21
        $view->set('sapi', PHP_SAPI);
22
23
        return 'server';
24
    }
25
}