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

NotIndenticalTest::testStaticFloatToFloat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

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