These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * Finance module for HiPanel |
||
4 | * |
||
5 | * @link https://github.com/hiqdev/hipanel-module-finance |
||
6 | * @package hipanel-module-finance |
||
7 | * @license BSD-3-Clause |
||
8 | * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/) |
||
9 | */ |
||
10 | |||
11 | namespace hipanel\modules\finance\grid; |
||
12 | |||
13 | use hipanel\modules\finance\menus\ProfileActionsMenu; |
||
14 | use hipanel\modules\finance\models\Tariff; |
||
15 | use hipanel\modules\finance\models\TariffProfile; |
||
16 | use hiqdev\yii2\menus\grid\MenuColumn; |
||
17 | use Yii; |
||
18 | use yii\helpers\Html; |
||
19 | |||
20 | class TariffProfileGridView extends \hipanel\grid\BoxedGridView |
||
21 | { |
||
22 | public function columns() |
||
23 | { |
||
24 | return array_merge(parent::columns(), [ |
||
25 | 'name' => [ |
||
26 | 'class' => 'hipanel\grid\MainColumn', |
||
27 | 'filterAttribute' => 'name_like', |
||
28 | 'note' => null, |
||
29 | 'value' => function (TariffProfile $model) { |
||
30 | if (empty($model->name) || $model->isDefault()) { |
||
31 | return Yii::t('hipanel.finance.tariffprofile', 'Default'); |
||
32 | } |
||
33 | |||
34 | return $model->name; |
||
0 ignored issues
–
show
|
|||
35 | }, |
||
36 | ], |
||
37 | 'tariff_names' => [ |
||
38 | 'filter' => false, |
||
39 | 'format' => 'raw', |
||
40 | 'value' => function (TariffProfile $model) { |
||
41 | if (empty($model->tariffs)) { |
||
0 ignored issues
–
show
The property
tariffs does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
42 | return ''; |
||
43 | } |
||
44 | |||
45 | foreach ($model->tariffs as $type => $values) { |
||
0 ignored issues
–
show
The property
tariffs does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
46 | if (empty($values)) { |
||
47 | continue; |
||
48 | } |
||
49 | |||
50 | $links = []; |
||
51 | foreach ($values as $id => $name) { |
||
52 | $links[$id] = $this->tariffLink($id, $name); |
||
53 | } |
||
54 | $tariffs[$type] = $model->getAttributeLabel($type) . ': ' . implode(', ', $links); |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
$tariffs was never initialized. Although not strictly required by PHP, it is generally a good practice to add $tariffs = array(); before regardless.
Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code. Let’s take a look at an example: foreach ($collection as $item) {
$myArray['foo'] = $item->getFoo();
if ($item->hasBar()) {
$myArray['bar'] = $item->getBar();
}
// do something with $myArray
}
As you can see in this example, the array This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop.
Loading history...
|
|||
55 | } |
||
56 | |||
57 | return implode('<br>', $tariffs); |
||
58 | }, |
||
59 | ], |
||
60 | 'domain_tariff' => [ |
||
61 | 'attribute' => 'domain', |
||
62 | 'format' => 'raw', |
||
63 | View Code Duplication | 'value' => function (TariffProfile $model) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
|
|||
64 | if (empty($model->domain)) { |
||
0 ignored issues
–
show
The property
domain does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
65 | return ''; |
||
66 | } |
||
67 | |||
68 | return $this->tariffLink($model->domain, $model->tariff_names[$model->domain]); |
||
0 ignored issues
–
show
The property
domain does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
The property
tariff_names does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
69 | }, |
||
70 | ], |
||
71 | 'certificate_tariff' => [ |
||
72 | 'attribute' => 'certificate', |
||
73 | 'format' => 'raw', |
||
74 | View Code Duplication | 'value' => function (TariffProfile $model) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
|
|||
75 | if (empty($model->certificate)) { |
||
0 ignored issues
–
show
The property
certificate does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
76 | return ''; |
||
77 | } |
||
78 | |||
79 | return $this->tariffLink($model->certificate, $model->tariff_names[$model->certificate]); |
||
0 ignored issues
–
show
The property
certificate does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
The property
tariff_names does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
80 | }, |
||
81 | ], |
||
82 | 'svds_tariff' => [ |
||
83 | 'attribute' => 'svds', |
||
84 | 'format' => 'raw', |
||
85 | View Code Duplication | 'value' => function (TariffProfile $model) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
|
|||
86 | if (empty($model->tariffs)) { |
||
0 ignored issues
–
show
The property
tariffs does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
87 | return ''; |
||
88 | } |
||
89 | |||
90 | if (empty($model->tariffs[Tariff::TYPE_XEN])) { |
||
0 ignored issues
–
show
The property
tariffs does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
91 | return ''; |
||
92 | } |
||
93 | |||
94 | foreach ($model->tariffs[Tariff::TYPE_XEN] as $id => $name) { |
||
0 ignored issues
–
show
The property
tariffs does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
95 | $links[$id] = $this->tariffLink($id, $name); |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
$links was never initialized. Although not strictly required by PHP, it is generally a good practice to add $links = array(); before regardless.
Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code. Let’s take a look at an example: foreach ($collection as $item) {
$myArray['foo'] = $item->getFoo();
if ($item->hasBar()) {
$myArray['bar'] = $item->getBar();
}
// do something with $myArray
}
As you can see in this example, the array This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop.
Loading history...
|
|||
96 | } |
||
97 | |||
98 | return implode(', ', $links); |
||
99 | }, |
||
100 | ], |
||
101 | 'ovds_tariff' => [ |
||
102 | 'attribute' => 'ovds', |
||
103 | 'format' => 'raw', |
||
104 | View Code Duplication | 'value' => function (TariffProfile $model) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
|
|||
105 | if (empty($model->tariffs)) { |
||
0 ignored issues
–
show
The property
tariffs does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
106 | return ''; |
||
107 | } |
||
108 | |||
109 | if (empty($model->tariffs[Tariff::TYPE_OPENVZ])) { |
||
0 ignored issues
–
show
The property
tariffs does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
110 | return ''; |
||
111 | } |
||
112 | |||
113 | foreach ($model->tariffs[Tariff::TYPE_OPENVZ] as $id => $name) { |
||
0 ignored issues
–
show
The property
tariffs does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
114 | $links[$id] = $this->tariffLink($id, $name); |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
$links was never initialized. Although not strictly required by PHP, it is generally a good practice to add $links = array(); before regardless.
Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code. Let’s take a look at an example: foreach ($collection as $item) {
$myArray['foo'] = $item->getFoo();
if ($item->hasBar()) {
$myArray['bar'] = $item->getBar();
}
// do something with $myArray
}
As you can see in this example, the array This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop.
Loading history...
|
|||
115 | } |
||
116 | |||
117 | return implode(', ', $links); |
||
118 | }, |
||
119 | ], |
||
120 | 'server_tariff' => [ |
||
121 | 'attribute' => 'server', |
||
122 | 'format' => 'raw', |
||
123 | View Code Duplication | 'value' => function (TariffProfile $model) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
|
|||
124 | if (empty($model->tariffs)) { |
||
0 ignored issues
–
show
The property
tariffs does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
125 | return ''; |
||
126 | } |
||
127 | |||
128 | if (empty($model->tariffs[Tariff::TYPE_SERVER])) { |
||
0 ignored issues
–
show
The property
tariffs does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
129 | return ''; |
||
130 | } |
||
131 | |||
132 | foreach ($model->tariffs[Tariff::TYPE_SERVER] as $id => $name) { |
||
0 ignored issues
–
show
The property
tariffs does not exist on object<hipanel\modules\f...e\models\TariffProfile> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property.
Loading history...
|
|||
133 | $links[$id] = $this->tariffLink($id, $name); |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
$links was never initialized. Although not strictly required by PHP, it is generally a good practice to add $links = array(); before regardless.
Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code. Let’s take a look at an example: foreach ($collection as $item) {
$myArray['foo'] = $item->getFoo();
if ($item->hasBar()) {
$myArray['bar'] = $item->getBar();
}
// do something with $myArray
}
As you can see in this example, the array This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop.
Loading history...
|
|||
134 | } |
||
135 | |||
136 | return implode(', ', $links); |
||
137 | }, |
||
138 | ], |
||
139 | 'actions' => [ |
||
140 | 'class' => MenuColumn::class, |
||
141 | 'menuClass' => ProfileActionsMenu::class, |
||
142 | ], |
||
143 | ]); |
||
144 | } |
||
145 | |||
146 | protected function tariffLink($id, $name) |
||
147 | { |
||
148 | return Html::a($name, ['@tariff/view', 'id' => $id]); |
||
149 | } |
||
150 | } |
||
151 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.