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
title does not exist on hidev\components\Vendor . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
35 | } |
||
36 | |||
37 | public function getDescription() |
||
38 | { |
||
39 | return $this->getItem('description') ?: $this->getTitle(); |
||
40 | } |
||
41 | } |
||
42 |