MailerDomainQuery::getListValues()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
namespace backend\models\query;
3
4
use yii\db\ActiveQuery;
5
use backend\models\MailerDomain;
6
7
class MailerDomainQuery extends ActiveQuery
8
{
9
    public function getListValues()
10
    {
11
        /** @var MailerDomain $domain */
12
        $domains = [];
13
        foreach ($this->all() as $domain) {
14
            $domains[$domain->id] = $domain->name;
0 ignored issues
show
Bug introduced by
Accessing name on the interface yii\db\ActiveRecordInterface suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
Bug introduced by
Accessing id on the interface yii\db\ActiveRecordInterface suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
15
        }
16
        return $domains;
17
    }
18
}
19