Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix issue where calling methods with positional parameters causes par…

…ameters to be lost if the first is null (e.g. $api->findLeads(null, 'id', 'asc', 50))
  • Loading branch information...
commit f8bde553fa3a38090ba056f8a0213e6aa7373e4d 1 parent 5248e81
Mason Malone MasonM authored
Showing with 6 additions and 8 deletions.
  1. +6 −8 NutshellApi.php
14 NutshellApi.php
View
@@ -77,14 +77,12 @@ function __destruct() {
*/
public function __call($name, $args) {
$params = null;
- if (isset($args[0])) {
- if (is_array($args[0])) {
- // e.g. $api->getLead(array('leadId' => 11))
- $params = $args[0];
- } else {
- // e.g. $api->getLead(11)
- $params = $args;
- }
+ if (count($args) === 1 && is_array($args[0])) {
+ // e.g. $api->getLead(array('leadId' => 11))
+ $params = $args[0];
+ } else {
+ // e.g. $api->getLead(11)
+ $params = $args;
}
return $this->call($name, $params);
}
Please sign in to comment.
Something went wrong with that request. Please try again.