Rand::parse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Luxifer\DQL\Numeric;
4
5
use Doctrine\ORM\Query\Lexer;
6
use Doctrine\ORM\Query\Parser;
7
use Doctrine\ORM\Query\SqlWalker;
8
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
9
10
class Rand extends FunctionNode
11
{
12 1
    public function parse(Parser $parser)
13
    {
14 1
        $parser->match(Lexer::T_IDENTIFIER);
15 1
        $parser->match(Lexer::T_OPEN_PARENTHESIS);
16 1
        $parser->match(Lexer::T_CLOSE_PARENTHESIS);
17 1
    }
18
19 1
    public function getSql(SqlWalker $sqlWalker)
20
    {
21 1
        return 'RAND()';
22
    }
23
}
24