Passed
Push — master ( afb0ae...0b11b9 )
by Radu
02:01
created

ControllerTrait::setupPaths()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
namespace ParcelValue\ApiClient\Traits;
3
4
trait ControllerTrait
5
{
6
    abstract protected function config();
7
    abstract protected function request();
8
    abstract protected function setData($key, $value);
9
10
    protected function setupPaths()
11
    {
12
        $this->setData('path', $this->config()->get('app/path'));
13
        $this->setData('url/app', $this->request()->getAppUrl());
14
        $this->setData('url/lang', $this->request()->getUrl(['lang']));
15
        $this->setData('url/current', $this->request()->getUrl());
16
    }
17
18
    /**
19
     * Called (optionally) by each method.
20
     */
21
    protected function init()
22
    {
23
    }
24
}
25