FileQuery::byId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * FileQuery.php
4
 * @author Revin Roman http://phptime.ru
5
 */
6
7
namespace rmrevin\yii\module\File\models\queries;
8
9
/**
10
 * Class FileQuery
11
 * @package rmrevin\yii\module\File\models\queries
12
 */
13
class FileQuery extends \yii\db\ActiveQuery
14
{
15
16
    /**
17
     * @param integer|array $id
18
     * @return static
19
     */
20 1
    public function byId($id)
21
    {
22 1
        $this->andWhere(['id' => $id]);
23
24 1
        return $this;
25
    }
26
27
    /**
28
     * @param string|array $hash
29
     * @return static
30
     */
31 6
    public function bySha1($hash)
32
    {
33 6
        $this->andWhere(['sha1' => $hash]);
34
35 6
        return $this;
36
    }
37
}