Vendor   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 22
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0
wmc 9

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getLabel() 0 3 2
A getDescription() 0 3 2
A getTitleAndHomepage() 0 3 2
A getTitle() 0 3 3
1
<?php
2
/**
3
 * Automation tool mixed with code generator for easier continuous development
4
 *
5
 * @link      https://github.com/hiqdev/hidev
6
 * @package   hidev
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hidev\components;
12
13
use hidev\helpers\Helper;
14
15
/**
16
 * Vendor part of the config.
17
 */
18
class Vendor extends \hidev\base\Component
19
{
20
    use \hiqdev\yii2\collection\ObjectTrait;
21
22
    public function getLabel()
23
    {
24
        return $this->getItem('label') ?: ucfirst($this->name);
25
    }
26
27
    public function getTitle()
28
    {
29
        return $this->getItem('title') ?: $this->getItem('description') ?: Helper::titleize($this->name);
30
    }
31
32
    public function getTitleAndHomepage()
33
    {
34
        return $this->title . ($this->homepage ? ' (' . $this->homepage . ')' : '');
0 ignored issues
show
Bug Best Practice introduced by
The property homepage does not exist on hidev\components\Vendor. Since you implemented __get, consider adding a @property annotation.
Loading history...
Bug Best Practice introduced by
The property title does not exist on hidev\components\Vendor. Since you implemented __get, consider adding a @property annotation.
Loading history...
35
    }
36
37
    public function getDescription()
38
    {
39
        return $this->getItem('description') ?: $this->getTitle();
40
    }
41
}
42