summaryrefslogtreecommitdiff
path: root/vendor/doctrine/dbal/src/Driver/PDO/Statement.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2026-10-18 00:08:23 +0200
committerpolo <ordipolo@gmx.fr>2026-10-18 00:10:03 +0200
commit05e38eadbeb3de19e5b26003c2b401e00bb71df4 (patch)
treecf48350b69cfce92de6f3a0e03eb0876931c7077 /vendor/doctrine/dbal/src/Driver/PDO/Statement.php
parent32843e50aa981f190bdb4fbc9adbeacc06fdf775 (diff)
downloadAppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.gz
AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.bz2
AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.zip
sortie de vendor du dépôt, oubli dans config-template.ini
Diffstat (limited to 'vendor/doctrine/dbal/src/Driver/PDO/Statement.php')
-rw-r--r--vendor/doctrine/dbal/src/Driver/PDO/Statement.php80
1 files changed, 0 insertions, 80 deletions
diff --git a/vendor/doctrine/dbal/src/Driver/PDO/Statement.php b/vendor/doctrine/dbal/src/Driver/PDO/Statement.php
deleted file mode 100644
index 4f0e070..0000000
--- a/vendor/doctrine/dbal/src/Driver/PDO/Statement.php
+++ /dev/null
@@ -1,80 +0,0 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\DBAL\Driver\PDO;
6
7use Doctrine\DBAL\Driver\Exception as ExceptionInterface;
8use Doctrine\DBAL\Driver\Statement as StatementInterface;
9use Doctrine\DBAL\ParameterType;
10use PDO;
11use PDOException;
12use PDOStatement;
13
14final class Statement implements StatementInterface
15{
16 /** @internal The statement can be only instantiated by its driver connection. */
17 public function __construct(private readonly PDOStatement $stmt)
18 {
19 }
20
21 public function bindValue(int|string $param, mixed $value, ParameterType $type): void
22 {
23 $pdoType = $this->convertParamType($type);
24
25 try {
26 $this->stmt->bindValue($param, $value, $pdoType);
27 } catch (PDOException $exception) {
28 throw Exception::new($exception);
29 }
30 }
31
32 /**
33 * @internal Driver options can be only specified by a PDO-based driver.
34 *
35 * @throws ExceptionInterface
36 */
37 public function bindParamWithDriverOptions(
38 string|int $param,
39 mixed &$variable,
40 ParameterType $type,
41 mixed $driverOptions,
42 ): void {
43 $pdoType = $this->convertParamType($type);
44
45 try {
46 $this->stmt->bindParam($param, $variable, $pdoType, 0, $driverOptions);
47 } catch (PDOException $exception) {
48 throw Exception::new($exception);
49 }
50 }
51
52 public function execute(): Result
53 {
54 try {
55 $this->stmt->execute();
56 } catch (PDOException $exception) {
57 throw Exception::new($exception);
58 }
59
60 return new Result($this->stmt);
61 }
62
63 /**
64 * Converts DBAL parameter type to PDO parameter type
65 *
66 * @psalm-return PDO::PARAM_*
67 */
68 private function convertParamType(ParameterType $type): int
69 {
70 return match ($type) {
71 ParameterType::NULL => PDO::PARAM_NULL,
72 ParameterType::INTEGER => PDO::PARAM_INT,
73 ParameterType::STRING,
74 ParameterType::ASCII => PDO::PARAM_STR,
75 ParameterType::BINARY,
76 ParameterType::LARGE_OBJECT => PDO::PARAM_LOB,
77 ParameterType::BOOLEAN => PDO::PARAM_BOOL,
78 };
79 }
80}