Conditions | 4 |
Paths | 4 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
43 | public function getDisplayDate() |
||
44 | { |
||
45 | if ($this->aggregation === 'month') { |
||
|
|||
46 | return Yii::$app->formatter->asDate(strtotime($this->date), 'LLL y'); |
||
47 | } elseif ($this->aggregation === 'week') { |
||
48 | return Yii::$app->formatter->asDate(strtotime($this->date), 'dd LLL y'); |
||
49 | } elseif ($this->aggregation === 'day') { |
||
50 | return Yii::$app->formatter->asDate(strtotime($this->date), 'dd LLL y'); |
||
51 | } |
||
52 | |||
53 | return Yii::$app->formatter->asDate(strtotime($this->date)); |
||
54 | } |
||
55 | } |
||
56 |
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.