QueryScope   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 11
ccs 3
cts 3
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A apply() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cycle\ORM\Select;
6
7
/**
8
 * Provides the ability to scope query and load necessary relations into the loader.
9
 */
10
final class QueryScope implements ScopeInterface
11
{
12 576
    public function __construct(
13
        private array $where,
14
        private array $orderBy = []
15
    ) {
16
    }
17
18 576
    public function apply(QueryBuilder $query): void
19
    {
20 576
        $query->where($this->where)->orderBy($this->orderBy);
21
    }
22
}
23