-
-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CS] Start to fix excluded ones #1749
[CS] Start to fix excluded ones #1749
Conversation
@@ -186,7 +186,7 @@ public function prepareUpdateData($document) | |||
// @ReferenceOne | |||
} elseif (isset($mapping['association']) && $mapping['association'] === ClassMetadata::REFERENCE_ONE) { | |||
if (isset($new) || $mapping['nullable'] === true) { | |||
$updateData['$set'][$mapping['name']] = (is_null($new) ? null : $this->prepareReferencedDocumentValue($mapping, $new)); | |||
$updateData['$set'][$mapping['name']] = ($new === null ? null : $this->prepareReferencedDocumentValue($mapping, $new)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be refactory to $new ?: $this->prepareReferencedDocumentValue($mapping, $new)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, as it would change the logic: null
s are to be left intact and everything else must go through prepare...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from nitpicks, LGTM 👍
@@ -257,7 +256,7 @@ public function prepareUpsertData($document) | |||
// @ReferenceOne | |||
} elseif (isset($mapping['association']) && $mapping['association'] === ClassMetadata::REFERENCE_ONE) { | |||
if (isset($new) || $mapping['nullable'] === true) { | |||
$updateData['$set'][$mapping['name']] = (is_null($new) ? null : $this->prepareReferencedDocumentValue($mapping, $new)); | |||
$updateData['$set'][$mapping['name']] = ($new === null ? null : $this->prepareReferencedDocumentValue($mapping, $new)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parentheses are unnecessary
@@ -186,7 +185,7 @@ public function prepareUpdateData($document) | |||
// @ReferenceOne | |||
} elseif (isset($mapping['association']) && $mapping['association'] === ClassMetadata::REFERENCE_ONE) { | |||
if (isset($new) || $mapping['nullable'] === true) { | |||
$updateData['$set'][$mapping['name']] = (is_null($new) ? null : $this->prepareReferencedDocumentValue($mapping, $new)); | |||
$updateData['$set'][$mapping['name']] = ($new === null ? null : $this->prepareReferencedDocumentValue($mapping, $new)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parentheses are unnecessary.
- Remove alias functions, as well forbidden ones - Remove assignments in if condition
Conflicts solved, should be RTM 👍 |
On this one:
if
condition