ShiftLeftTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 4 1
A getSupportedTypes() 0 8 1
A buildExpression() 0 4 1
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 ShiftLeftTest extends AbstractBinaryOp
11
{
12
    /**
13
     * @param $a
14
     * @param $b
15
     * @return mixed
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\ShiftLeft
38
     */
39
    protected function buildExpression($a, $b)
40
    {
41
        return new Node\Expr\AssignOp\ShiftLeft($a, $b);
42
    }
43
}
44