Branding   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 1
dl 0
loc 33
ccs 0
cts 24
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A asset() 0 4 1
A link() 0 4 3
A developer() 0 4 1
A url() 0 4 1
A get() 0 10 2
1
<?php
2
3
namespace Zoutapps\Laravel\Backpack\Branding;
4
5
use Illuminate\Support\Facades\Config;
6
7
class Branding
8
{
9
    public function asset($key)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
10
    {
11
        return asset($this->get('asset.' . $key));
12
    }
13
14
    public function link($content = null, $class = null, $target = '_blank')
15
    {
16
        return '<a href="' . $this->url() . '" ' . ($class ? 'class="' . $class . '" ' : '') . 'target="' . $target . '">' . ($content ? $content : $this->url()) . '</a>';
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 171 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
17
    }
18
19
    public function developer()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
20
    {
21
        return $this->get('developer');
22
    }
23
24
    public function url()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
25
    {
26
        return $this->get('url');
27
    }
28
29
    private function get($key)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
30
    {
31
        $configKey = 'zoutapps.branding.' . $key;
32
33
        if (!Config::has($configKey)) {
34
            throw new \InvalidArgumentException('Your branding value ' . $key . ' is not specified. Please add the desired value to <comment>config/zoutapps/branding.php</comment> in order to use it.');
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 202 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
35
        }
36
37
        return config($configKey);
38
    }
39
}