SourceFilterUtil::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/*
3
 * This file is part of the Exchange Rate package, an RunOpenCode project.
4
 *
5
 * (c) 2017 RunOpenCode
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace RunOpenCode\ExchangeRate\Utils;
11
12
use RunOpenCode\ExchangeRate\Contract\SourceInterface;
13
14
/**
15
 * Class SourceFilterUtil
16
 *
17
 * Utility to check if source matches filters.
18
 *
19
 * @package RunOpenCode\ExchangeRate\Utils
20
 */
21
final class SourceFilterUtil
22
{
23
    use FilterUtilHelper;
24
25
    private function __construct() { /* noop */ }
26
27
    /**
28
     * Check if rate matches filters.
29
     *
30
     * @param SourceInterface $source Rate to filter.
31
     * @param array $criteria Filter criteria.
32
     * @return bool TRUE if filter criteria is matched.
33
     */
34 2
    public static function matches(SourceInterface $source, array $criteria)
35
    {
36
        return
37 2
            self::matchesArrayCriteria('name', $source, $criteria)
38
            ;
39
    }
40
}
41