Skip to content
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

Merged
merged 6 commits into from
Aug 26, 2016
Merged

Patch 2 #142

merged 6 commits into from
Aug 26, 2016

Conversation

i0
Copy link
Contributor

@i0 i0 commented Aug 19, 2016

if ($weight !== null) {
$content['weight'] = $weight;
}

return $this->updateFields($domainName, $recordId, ['name' => $name]);
Copy link
Contributor

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.

i0 added 2 commits August 20, 2016 20:56
some code correction
'port' => $port,
'weight' => $weight
);
$content = array_filter($content);
Copy link
Member

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;
Copy link
Member

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
@yassirh
Copy link
Contributor

yassirh commented Aug 21, 2016

LGTM. @GrahamCampbell what do you think? If everything is OK you can merge. @i0 Thanks!

@yassirh yassirh merged commit a658fcf into DigitalOceanPHP:master Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants