SearchCriteria   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 6
dl 0
loc 24
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fetch() 0 12 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://github.com/flipbox/salesforce/blob/master/LICENSE.md
6
 * @link       https://github.com/flipbox/salesforce
7
 */
8
9
namespace Flipbox\Salesforce\Criteria;
10
11
use Flipbox\Salesforce\Resources\Search;
12
use Flipbox\Salesforce\Search\SearchBuilderAttributeTrait;
13
use Psr\Http\Message\ResponseInterface;
14
15
/**
16
 * @author Flipbox Factory <[email protected]>
17
 * @since 3.3.0
18
 */
19
class SearchCriteria extends AbstractCriteria
20
{
21
    use ConnectionTrait,
22
        CacheTrait,
23
        SearchBuilderAttributeTrait;
24
25
    /**
26
     * @param array $criteria
27
     * @param array $config
28
     * @return ResponseInterface
29
     */
30
    public function fetch(array $criteria = [], array $config = []): ResponseInterface
31
    {
32
        $this->populate($criteria);
33
34
        return Search::search(
35
            $this->getSearch()->build(),
36
            $this->getConnection(),
37
            $this->getCache(),
38
            $this->getLogger(),
39
            $config
40
        );
41
    }
42
}
43