MailerDomainQuery   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getListValues() 0 8 2
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