Passed
Pull Request — master (#4)
by Alex
03:23
created

IsEqualTest::testFilterWillApplyIsEqualFiltering()   A

Complexity

Conditions 4
Paths 8

Size

Total Lines 58
Code Lines 40

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 40
c 1
b 0
f 0
dl 0
loc 58
rs 9.28
cc 4
nc 8
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace ArpTest\DoctrineQueryFilter\Filter;
6
7
use Arp\DoctrineQueryFilter\Filter\IsEqual;
8
9
/**
10
 * @covers \Arp\DoctrineQueryFilter\Filter\IsEqual
11
 *
12
 * @author  Alex Patterson <[email protected]>
13
 * @package ArpTest\DoctrineQueryFilter\Filter
14
 */
15
final class IsEqualTest extends AbstractComparisonTest
16
{
17
    /**
18
     * @var string
19
     */
20
    protected string $filterClassName = IsEqual::class;
21
22
    /**
23
     * @var string
24
     */
25
    protected string $expressionMethodName = 'eq';
26
27
    /**
28
     * @var string
29
     */
30
    protected string $expressionSymbol = '=';
31
32
    /**
33
     * @return array
34
     */
35
    public function getFilterWillApplyFilteringData(): array
36
    {
37
        return [
38
            [
39
                [
40
                    'name' => 'test',
41
                    'field' => 'hello',
42
                    'value'=> 123,
0 ignored issues
show
Coding Style introduced by
Expected at least 1 space before "=>"; 0 found
Loading history...
43
                ],
44
            ],
45
        ];
46
    }
47
}
48