ListQuery   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fetchData() 0 5 2
A andWhereBoard() 0 4 1
1
<?php
2
3
4
namespace carono\yii2trello\query;
5
6
7
use carono\yii2trello\Board;
8
9
/**
10
 * Class ListQuery
11
 *
12
 * @package carono\yii2trello\query
13
 */
14
class ListQuery extends Query
15
{
16
    protected $board;
17
18
    /**
19
     * @param $id
20
     * @return $this
21
     */
22
    public function andWhereBoard($id)
23
    {
24
        $this->board = $id;
25
        return $this;
26
    }
27
28
    protected function fetchData(): array
29
    {
30
        $board = Board::find()->andWhereMember($this->member)->andWhere(['id' => $this->board])->one($this->client);
31
        $this->from = $board ? $board->getLists() : [];
32
        return parent::fetchData();
33
    }
34
}