-
Notifications
You must be signed in to change notification settings - Fork 170
/
TracingStatementForV3.php
45 lines (38 loc) · 1.19 KB
/
TracingStatementForV3.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
declare(strict_types=1);
namespace Sentry\SentryBundle\Tracing\Doctrine\DBAL;
use Doctrine\DBAL\Driver\Result;
use Doctrine\DBAL\Driver\Statement;
use Doctrine\DBAL\ParameterType;
use Sentry\Tracing\SpanContext;
/**
* @internal
*/
final class TracingStatementForV3 extends AbstractTracingStatement implements Statement
{
/**
* {@inheritdoc}
*/
public function bindValue($param, $value, $type = ParameterType::STRING): bool
{
return $this->decoratedStatement->bindValue($param, $value, $type);
}
/**
* {@inheritdoc}
*/
public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null): bool
{
return $this->decoratedStatement->bindParam($param, $variable, $type, ...\array_slice(\func_get_args(), 3));
}
/**
* {@inheritdoc}
*/
public function execute($params = null): Result
{
$spanContext = new SpanContext();
$spanContext->setOp(self::SPAN_OP_STMT_EXECUTE);
$spanContext->setDescription($this->sqlQuery);
$spanContext->setTags($this->spanTags);
return $this->traceFunction($spanContext, [$this->decoratedStatement, 'execute'], $params);
}
}