summaryrefslogtreecommitdiff
path: root/vendor/doctrine/orm/src/Query/AST/InputParameter.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2024-08-13 23:45:21 +0200
committerpolo <ordipolo@gmx.fr>2024-08-13 23:45:21 +0200
commitbf6655a534a6775d30cafa67bd801276bda1d98d (patch)
treec6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/doctrine/orm/src/Query/AST/InputParameter.php
parent94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff)
downloadAppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/doctrine/orm/src/Query/AST/InputParameter.php')
-rw-r--r--vendor/doctrine/orm/src/Query/AST/InputParameter.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Query/AST/InputParameter.php b/vendor/doctrine/orm/src/Query/AST/InputParameter.php
new file mode 100644
index 0000000..a8e0a3b
--- /dev/null
+++ b/vendor/doctrine/orm/src/Query/AST/InputParameter.php
@@ -0,0 +1,35 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Query\AST;
6
7use Doctrine\ORM\Query\QueryException;
8use Doctrine\ORM\Query\SqlWalker;
9
10use function is_numeric;
11use function strlen;
12use function substr;
13
14class InputParameter extends Node
15{
16 public bool $isNamed;
17 public string $name;
18
19 /** @throws QueryException */
20 public function __construct(string $value)
21 {
22 if (strlen($value) === 1) {
23 throw QueryException::invalidParameterFormat($value);
24 }
25
26 $param = substr($value, 1);
27 $this->isNamed = ! is_numeric($param);
28 $this->name = $param;
29 }
30
31 public function dispatch(SqlWalker $walker): string
32 {
33 return $walker->walkInputParameter($this);
34 }
35}