vendor/sentry/sentry-symfony/src/Tracing/Doctrine/DBAL/TracingStatementForV2.php line 124

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sentry\SentryBundle\Tracing\Doctrine\DBAL;
  4. use Doctrine\DBAL\Driver\Statement;
  5. use Doctrine\DBAL\ParameterType;
  6. use Sentry\Tracing\SpanContext;
  7. /**
  8.  * @internal
  9.  *
  10.  * @phpstan-implements \IteratorAggregate<mixed>
  11.  */
  12. final class TracingStatementForV2 extends AbstractTracingStatement implements \IteratorAggregateStatement
  13. {
  14.     /**
  15.      * {@inheritdoc}
  16.      */
  17.     public function getIterator(): \Traversable
  18.     {
  19.         return $this->decoratedStatement;
  20.     }
  21.     /**
  22.      * {@inheritdoc}
  23.      */
  24.     public function closeCursor(): bool
  25.     {
  26.         return $this->decoratedStatement->closeCursor();
  27.     }
  28.     /**
  29.      * {@inheritdoc}
  30.      */
  31.     public function columnCount(): int
  32.     {
  33.         return $this->decoratedStatement->columnCount();
  34.     }
  35.     /**
  36.      * {@inheritdoc}
  37.      */
  38.     public function setFetchMode($fetchMode$arg2 null$arg3 null): bool
  39.     {
  40.         return $this->decoratedStatement->setFetchMode($fetchMode$arg2$arg3);
  41.     }
  42.     /**
  43.      * {@inheritdoc}
  44.      */
  45.     public function fetch($fetchMode null$cursorOrientation = \PDO::FETCH_ORI_NEXT$cursorOffset 0)
  46.     {
  47.         return $this->decoratedStatement->fetch($fetchMode$cursorOrientation$cursorOffset);
  48.     }
  49.     /**
  50.      * {@inheritdoc}
  51.      */
  52.     public function fetchAll($fetchMode null$fetchArgument null$ctorArgs null)
  53.     {
  54.         return $this->decoratedStatement->fetchAll($fetchMode$fetchArgument$ctorArgs);
  55.     }
  56.     /**
  57.      * {@inheritdoc}
  58.      */
  59.     public function fetchColumn($columnIndex 0)
  60.     {
  61.         return $this->decoratedStatement->fetchColumn($columnIndex);
  62.     }
  63.     /**
  64.      * {@inheritdoc}
  65.      */
  66.     public function errorCode()
  67.     {
  68.         return $this->decoratedStatement->errorCode();
  69.     }
  70.     /**
  71.      * {@inheritdoc}
  72.      */
  73.     public function errorInfo(): array
  74.     {
  75.         return $this->decoratedStatement->errorInfo();
  76.     }
  77.     /**
  78.      * {@inheritdoc}
  79.      */
  80.     public function rowCount(): int
  81.     {
  82.         return $this->decoratedStatement->rowCount();
  83.     }
  84.     /**
  85.      * {@inheritdoc}
  86.      */
  87.     public function bindValue($param$value$type ParameterType::STRING): bool
  88.     {
  89.         return $this->decoratedStatement->bindValue($param$value$type);
  90.     }
  91.     /**
  92.      * {@inheritdoc}
  93.      */
  94.     public function bindParam($param, &$variable$type ParameterType::STRING$length null): bool
  95.     {
  96.         return $this->decoratedStatement->bindParam($param$variable$type$length ?? 0, ...\array_slice(\func_get_args(), 4));
  97.     }
  98.     /**
  99.      * {@inheritdoc}
  100.      */
  101.     public function execute($params null): bool
  102.     {
  103.         $spanContext = new SpanContext();
  104.         $spanContext->setOp(self::SPAN_OP_STMT_EXECUTE);
  105.         $spanContext->setDescription($this->sqlQuery);
  106.         $spanContext->setTags($this->spanTags);
  107.         return $this->traceFunction($spanContext, [$this->decoratedStatement'execute'], $params);
  108.     }
  109. }