Skip to content

Commit

Permalink
Merge pull request #1937 from juliusstoerrle/patch-1
Browse files Browse the repository at this point in the history
Removed PHP 5.5 workaround
  • Loading branch information
alcaeus committed Jan 21, 2019
2 parents 040b187 + 07220f8 commit 70d125a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php
Expand Up @@ -1013,9 +1013,7 @@ private function prepareQueryElement(string $fieldName, $value = null, ?ClassMet
}

// No further preparation unless we're dealing with a simple reference
// We can't have expressions in empty() with PHP < 5.5, so store it in a variable
$arrayValue = (array) $value;
if (empty($mapping['reference']) || $mapping['storeAs'] !== ClassMetadata::REFERENCE_STORE_AS_ID || empty($arrayValue)) {
if (empty($mapping['reference']) || $mapping['storeAs'] !== ClassMetadata::REFERENCE_STORE_AS_ID || empty((array) $value)) {
return [[$fieldName, $value]];
}

Expand Down

0 comments on commit 70d125a

Please sign in to comment.