Param   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 3
c 1
b 0
f 0
dl 0
loc 14
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A __construct() 0 2 1
A getValue() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Command;
6
7
use Yiisoft\Db\Expression\ExpressionInterface;
8
9
/**
10
 * Represents a parameter used in building an SQL statement.
11
 *
12
 * It can be used to represent a placeholder in an SQL statement, and can be bound to a specific value when the
13
 * statement is executed.
14
 *
15
 * It can also represent a column name or table name, depending on the context in which it's
16
 * used. The class provides methods for specifying the parameter name, value, as well as methods for quoting and
17
 * escaping the parameter value to ensure that it's handled by the database.
18
 */
19
final class Param implements ParamInterface, ExpressionInterface
20
{
21
    public function __construct(private mixed $value, private int $type)
22
    {
23
    }
24
25
    public function getType(): int
26
    {
27
        return $this->type;
28
    }
29
30
    public function getValue(): mixed
31
    {
32
        return $this->value;
33
    }
34
}
35