Skip to content

Commit

Permalink
Use bound instead of binded.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwage authored and morozov committed Jan 3, 2020
1 parent e32bf29 commit 32cdec3
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ final class MysqliStatement implements IteratorAggregate, Statement
private $columnNames;

/** @var mixed[] */
private $rowBindedValues = [];
private $rowBoundValues = [];

/** @var mixed[] */
private $bindedValues = [];
private $boundValues = [];

/** @var string */
private $types;
Expand Down Expand Up @@ -99,8 +99,8 @@ public function __construct(mysqli $conn, string $sql)
return;
}

$this->types = str_repeat('s', $paramCount);
$this->bindedValues = array_fill(1, $paramCount, null);
$this->types = str_repeat('s', $paramCount);
$this->boundValues = array_fill(1, $paramCount, null);
}

/**
Expand All @@ -114,8 +114,8 @@ public function bindParam($param, &$variable, int $type = ParameterType::STRING,
throw UnknownType::new($type);
}

$this->bindedValues[$param] =& $variable;
$this->types[$param - 1] = self::$paramTypeMap[$type];
$this->boundValues[$param] =& $variable;
$this->types[$param - 1] = self::$paramTypeMap[$type];
}

/**
Expand All @@ -129,9 +129,9 @@ public function bindValue($param, $value, int $type = ParameterType::STRING) : v
throw UnknownType::new($type);
}

$this->values[$param] = $value;
$this->bindedValues[$param] =& $this->values[$param];
$this->types[$param - 1] = self::$paramTypeMap[$type];
$this->values[$param] = $value;
$this->boundValues[$param] =& $this->values[$param];
$this->types[$param - 1] = self::$paramTypeMap[$type];
}

/**
Expand Down Expand Up @@ -187,10 +187,10 @@ public function execute(?array $params = null) : void
// It's also important that row values are bound after _each_ call to store_result(). Otherwise,
// if mysqli is compiled with libmysql, subsequently fetched string values will get truncated
// to the length of the ones fetched during the previous execution.
$this->rowBindedValues = array_fill(0, count($this->columnNames), null);
$this->rowBoundValues = array_fill(0, count($this->columnNames), null);

$refs = [];
foreach ($this->rowBindedValues as $key => &$value) {
foreach ($this->rowBoundValues as $key => &$value) {
$refs[$key] =& $value;
}

Expand All @@ -212,7 +212,7 @@ private function bindTypedParameters() : void
$streams = $values = [];
$types = $this->types;

foreach ($this->bindedValues as $parameter => $value) {
foreach ($this->boundValues as $parameter => $value) {
if (! isset($types[$parameter - 1])) {
$types[$parameter - 1] = static::$paramTypeMap[ParameterType::STRING];
}
Expand Down Expand Up @@ -290,7 +290,7 @@ private function _fetch()

if ($ret === true) {
$values = [];
foreach ($this->rowBindedValues as $v) {
foreach ($this->rowBoundValues as $v) {
$values[] = $v;
}

Expand Down

0 comments on commit 32cdec3

Please sign in to comment.