). * * Oracle does not support positional parameters, hence this method converts all * positional parameters into artificially named parameters. * * @internal This class is not covered by the backward compatibility promise */ final class ConvertPositionalToNamedPlaceholders implements Visitor { /** @var list */ private $buffer = []; /** @var array */ private $parameterMap = []; public function acceptOther(string $sql): void { $this->buffer[] = $sql; } public function acceptPositionalParameter(string $sql): void { $position = count($this->parameterMap) + 1; $param = ':param' . $position; $this->parameterMap[$position] = $param; $this->buffer[] = $param; } public function acceptNamedParameter(string $sql): void { $this->buffer[] = $sql; } public function getSQL(): string { return implode('', $this->buffer); } /** * @return array */ public function getParameterMap(): array { return $this->parameterMap; } }