Completed
Push — master ( 0c0f7b...d6a494 )
by Дмитрий
9s
created

BitwiseAndTest::buildExpression()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
nc 1
dl 0
loc 4
c 0
b 0
f 0
cc 1
eloc 2
nop 2
rs 10
1
<?php
2
3
namespace Tests\PHPSA\Compiler\Expression\AssignOp;
4
5
use PhpParser\Node;
6
use PHPSA\CompiledExpression;
7
use PHPSA\Compiler\Expression;
8
use Tests\PHPSA\Compiler\Expression\AbstractBinaryOp;
9
10
class BitwiseAndTest extends AbstractBinaryOp
11
{
12
    /**
13
     * @param $a
14
     * @param $b
15
     * @return integer
16
     */
17
    protected function process($a, $b)
18
    {
19
        return $a & $b;
20
    }
21
22
    /**
23
     * @return array
24
     */
25
    protected function getSupportedTypes()
26
    {
27
        return [
28
            CompiledExpression::INTEGER,
29
            CompiledExpression::DOUBLE,
30
            CompiledExpression::BOOLEAN,
31
        ];
32
    }
33
34
    /**
35
     * @param Node\Scalar $a
36
     * @param Node\Scalar $b
37
     * @return Node\Expr\AssignOp\BitwiseAnd
38
     */
39
    protected function buildExpression($a, $b)
40
    {
41
        return new Node\Expr\AssignOp\BitwiseAnd($a, $b);
42
    }
43
}
44