vendor/doctrine/orm/src/Query/Expr/Func.php line 14

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Doctrine\ORM\Query\Expr;
  4. use function implode;
  5. /**
  6.  * Expression class for generating DQL functions.
  7.  *
  8.  * @link    www.doctrine-project.org
  9.  */
  10. class Func
  11. {
  12.     /** @var string */
  13.     protected $name;
  14.     /** @var mixed[] */
  15.     protected $arguments;
  16.     /**
  17.      * Creates a function, with the given argument.
  18.      *
  19.      * @param string        $name
  20.      * @param mixed[]|mixed $arguments
  21.      * @psalm-param list<mixed>|mixed $arguments
  22.      */
  23.     public function __construct($name$arguments)
  24.     {
  25.         $this->name      $name;
  26.         $this->arguments = (array) $arguments;
  27.     }
  28.     /** @return string */
  29.     public function getName()
  30.     {
  31.         return $this->name;
  32.     }
  33.     /** @psalm-return list<mixed> */
  34.     public function getArguments()
  35.     {
  36.         return $this->arguments;
  37.     }
  38.     /** @return string */
  39.     public function __toString()
  40.     {
  41.         return $this->name '(' implode(', '$this->arguments) . ')';
  42.     }
  43. }