diff options
Diffstat (limited to 'vendor/doctrine/orm/src/Query/Expr/Func.php')
-rw-r--r-- | vendor/doctrine/orm/src/Query/Expr/Func.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Query/Expr/Func.php b/vendor/doctrine/orm/src/Query/Expr/Func.php new file mode 100644 index 0000000..cd9e8e0 --- /dev/null +++ b/vendor/doctrine/orm/src/Query/Expr/Func.php | |||
@@ -0,0 +1,48 @@ | |||
1 | <?php | ||
2 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Doctrine\ORM\Query\Expr; | ||
6 | |||
7 | use Stringable; | ||
8 | |||
9 | use function implode; | ||
10 | |||
11 | /** | ||
12 | * Expression class for generating DQL functions. | ||
13 | * | ||
14 | * @link www.doctrine-project.org | ||
15 | */ | ||
16 | class Func implements Stringable | ||
17 | { | ||
18 | /** @var mixed[] */ | ||
19 | protected array $arguments; | ||
20 | |||
21 | /** | ||
22 | * Creates a function, with the given argument. | ||
23 | * | ||
24 | * @psalm-param list<mixed>|mixed $arguments | ||
25 | */ | ||
26 | public function __construct( | ||
27 | protected string $name, | ||
28 | mixed $arguments, | ||
29 | ) { | ||
30 | $this->arguments = (array) $arguments; | ||
31 | } | ||
32 | |||
33 | public function getName(): string | ||
34 | { | ||
35 | return $this->name; | ||
36 | } | ||
37 | |||
38 | /** @psalm-return list<mixed> */ | ||
39 | public function getArguments(): array | ||
40 | { | ||
41 | return $this->arguments; | ||
42 | } | ||
43 | |||
44 | public function __toString(): string | ||
45 | { | ||
46 | return $this->name . '(' . implode(', ', $this->arguments) . ')'; | ||
47 | } | ||
48 | } | ||