Skip to content

Commit

Permalink
PHP 7.2 - deprecated "each" calls
Browse files Browse the repository at this point in the history
PHP 7.2 - deprecated "each" calls
  • Loading branch information
vitaliytv committed Mar 13, 2018
1 parent dccb4f8 commit f44654a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/Connection/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private function _executeDeletions(array $deletions)
$params = array();
$columnNames = array();
foreach ($identifierMaps as $idMap) {
while (list($fieldName, $value) = each($idMap)) {
foreach($idMap as $fieldName => $value) {
$params[] = $value;
$columnNames[] = $table->getColumnName($fieldName);
}
Expand Down Expand Up @@ -957,4 +957,4 @@ protected function _assignIdentifier(Doctrine_Record $record)
$record->assignIdentifier(true);
}
}
}
}
15 changes: 8 additions & 7 deletions lib/Doctrine/Hydrator/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,14 @@ protected function _getClassnameToReturn(array &$data, $component)
$matchedComponents[] = $table->getComponentName();
}
} else {
list($key, $value) = each($inheritanceMap);
$key = $this->_tables[$component]->getFieldName($key);
if ( ! isset($data[$key]) || $data[$key] != $value) {
continue;
} else {
$matchedComponents[] = $table->getComponentName();
}
foreach($inheritanceMap as $key => $value) {
$key = $this->_tables[$component]->getFieldName($key);
if ( ! isset($data[$key]) || $data[$key] != $value) {
continue;
} else {
$matchedComponents[] = $table->getComponentName();
}
}
}
}

Expand Down

0 comments on commit f44654a

Please sign in to comment.