Skip to content

Commit

Permalink
immediately return the value instead of assigning it to a temporary v…
Browse files Browse the repository at this point in the history
…ariable
  • Loading branch information
philiplb committed Aug 25, 2020
1 parent 9cde545 commit 4e10056
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/CRUDlex/AbstractData.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,10 @@ protected function deleteChildren($id, $deleteCascade)
*/
protected function getReferenceIds(array $entities, $field)
{
$ids = array_map(function(Entity $entity) use ($field) {
return array_map(function(Entity $entity) use ($field) {
$id = $entity->get($field);
return is_array($id) ? $id['id'] : $id;
}, $entities);
return $ids;
}

/**
Expand Down

0 comments on commit 4e10056

Please sign in to comment.