BitwiseNotTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 32
c 0
b 0
f 0
rs 10
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\Operators\Bitwise;
4
5
use PhpParser\Node;
6
use PHPSA\CompiledExpression;
7
use PHPSA\Compiler\Expression;
8
use Tests\PHPSA\Compiler\Expression\AbstractUnaryOp;
9
10
class BitwiseNotTest extends AbstractUnaryOp
11
{
12
    /**
13
     * @param $a
14
     * @return array
15
     */
16
    protected function process($a)
17
    {
18
        return ~$a;
19
    }
20
21
    /**
22
     * @return array
23
     */
24
    protected function getSupportedTypes()
25
    {
26
        return [
27
            CompiledExpression::INTEGER,
28
            CompiledExpression::DOUBLE,
29
            CompiledExpression::STRING,
30
        ];
31
    }
32
33
    /**
34
     * @param Node\Scalar $a
35
     * @return Node\Expr\BitwiseNot
36
     */
37
    protected function buildExpression($a)
38
    {
39
        return new Node\Expr\BitwiseNot($a);
40
    }
41
}
42