Skip to content

Commit

Permalink
fix: use 'sprintf' instead of string interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassouzavieira committed May 23, 2024
1 parent 8a088e4 commit 940ec00
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/AQL/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use ArangoDB\Validation\Exceptions\InvalidParameterException;

/**
* Represents an prepared AQL Statement
* Represents a prepared AQL Statement
*
* @package ArangoDB\AQL
* @author Lucas S. Vieira
Expand All @@ -22,7 +22,7 @@ class Statement implements StatementInterface
*
* @var string
*/
protected $query;
protected string $query;

/**
* If the statement use an alias for collection,
Expand All @@ -31,7 +31,7 @@ class Statement implements StatementInterface
*
* @var string
*/
protected $collectionAlias = '';
protected string $collectionAlias = '';

/**
* Validator for binding values or params
Expand All @@ -45,7 +45,7 @@ class Statement implements StatementInterface
*
* @var array
*/
protected $queryParameters = [];
protected array $queryParameters = [];

/**
* Contains all references calling 'bindValue' method
Expand All @@ -59,7 +59,7 @@ class Statement implements StatementInterface
*
* @var array
*/
protected $formats = [
protected array $formats = [
'float' => "%F",
'integer' => "%d",
'string' => "'%s'",
Expand Down Expand Up @@ -153,7 +153,7 @@ public function toAql(): string

foreach ($this->queryParameters as $parameter) {
if (!$this->container->has($parameter)) {
throw new StatementException("Parameter ($parameter) was not defined for this statement");
throw new StatementException(sprintf("Parameter (%s) was not defined for this statement", $parameter));
}

$query = str_replace($parameter, $this->output($parameter), $query);
Expand Down

0 comments on commit 940ec00

Please sign in to comment.