InArrayInversedFilter::match()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 3
1
<?php
2
/**
3
 * This file is part of the ArrayQuery package.
4
 *
5
 * (c) Mauro Cassani<https://github.com/mauretto78>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace ArrayQuery\Filters\Criterion;
12
13
use ArrayQuery\Helpers\ArrayHelper;
14
15
class InArrayInversedFilter implements FilterInterface
16
{
17
    /**
18
     * @param $value
19
     * @param $valueToCompare
20
     * @return bool
21
     */
22
    public function match($value, $valueToCompare, $dateFormat = null)
23
    {
24
        return in_array($valueToCompare, ArrayHelper::convertToPlainArray($value));
25
    }
26
}
27