Passed
Push — new-json-functions ( f0f3c9...831e7d )
by Martin
03:09
created

JsonSerialize::validateArguments()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 2
c 1
b 0
f 1
nc 2
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MartinGeorgiev\Doctrine\ORM\Query\AST\Functions;
6
7
/**
8
 * Implementation of PostgreSQL JSON_SERIALIZE().
9
 *
10
 * Supports basic form:
11
 * - json_serialize(expression)
12
 *
13
 * @see https://www.postgresql.org/docs/17/functions-json.html
14
 * @since 2.10
15
 *
16
 * @author Martin Georgiev <[email protected]>
17
 */
18
class JsonSerialize extends BaseFunction
19
{
20
    protected function customizeFunction(): void
21
    {
22
        $this->setFunctionPrototype('json_serialize(%s)');
23
        $this->addNodeMapping('StringPrimary');
24
    }
25
}
26