Completed
Pull Request — master (#304)
by Enrico
02:53
created

LogicalXorTest::getDataProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 18
nc 1
nop 0
dl 0
loc 21
rs 9.3142
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A LogicalXorTest::process() 0 4 1
A LogicalXorTest::getSupportedTypes() 0 10 1
1
<?php
2
3
namespace Tests\PHPSA\Compiler\Expression\Operators\Logical;
4
5
use PhpParser\Node;
6
use PHPSA\CompiledExpression;
7
use PHPSA\Compiler\Expression;
8
use Tests\PHPSA\Compiler\Expression\AbstractBinaryOp;
9
10
class LogicalXorTest extends AbstractBinaryOp
11
{
12
    /**
13
     * @param $a
14
     * @param $b
15
     * @return bool
16
     */
17
    protected function process($a, $b)
18
    {
19
        return $a xor $b;
20
    }
21
22
    /**
23
     * @return array
24
     */
25
    protected function getSupportedTypes()
26
    {
27
        return [
28
            CompiledExpression::INTEGER,
29
            CompiledExpression::DOUBLE,
30
            CompiledExpression::STRING,
31
            CompiledExpression::BOOLEAN,
32
            CompiledExpression::NULL,
33
        ];
34
    }
35
36
    /**
37
     * @param Node\Scalar $a
38
     * @param Node\Scalar $b
39
     * @return Node\Expr\BinaryOp\LogicalXor
40
     */
41
    protected function buildExpression($a, $b)
42
    {
43
        return new Node\Expr\BinaryOp\LogicalXor($a, $b);
44
    }
45
}
46