-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Patch 2 #142
Patch 2 #142
Conversation
Improve update method of domainRecord
if ($weight !== null) { | ||
$content['weight'] = $weight; | ||
} | ||
|
||
return $this->updateFields($domainName, $recordId, ['name' => $name]); |
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.
You forgot to call the updateFields
method with the $content
array.
some code correction
correct
'port' => $port, | ||
'weight' => $weight | ||
); | ||
$content = array_filter($content); |
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.
Please pass a callback function into here so that null values are filtered only, instead of just empty ones.
add callback to filter null and false values
'weight' => $weight | ||
); | ||
$content = array_filter($content, function($val){ | ||
return $val !== null && $val !== false; |
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.
why false?
remove false condition and use compact function
LGTM. @GrahamCampbell what do you think? If everything is OK you can merge. @i0 Thanks! |
Improve domain record update function:
https://developers.digitalocean.com/documentation/v2/#update-a-domain-record