Completed
Push — master ( 9c7fd0...afc45c )
by Andrii
10:58
created

TargetRepository::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 9
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 3
crap 2
1
<?php
2
/**
3
 * API for Billing
4
 *
5
 * @link      https://github.com/hiqdev/billing-hiapi
6
 * @package   billing-hiapi
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\billing\hiapi\target;
12
13
use hiqdev\php\billing\target\Target;
14
use hiqdev\yii\DataMapper\query\Specification;
15
16
class TargetRepository extends \hiqdev\yii\DataMapper\repositories\BaseRepository
17
{
18
    public function findOneById($id): ?Target
19
    {
20
        return $this->findOne((new Specification())->andWhere(['id' => $id]));
21
    }
22
}
23