Skip to content

Commit

Permalink
Fix toArray() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe committed Aug 30, 2019
1 parent cbfa552 commit 106e6f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/StripeObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function refreshFrom($values, $opts, $partial = false)
$this->_originalValues = self::deepCopy($values);

if ($values instanceof StripeObject) {
$values = $values->toArray(true);
$values = $values->toArray();
}

// Wipe old state before setting new. This is useful for e.g. updating a
Expand Down Expand Up @@ -401,7 +401,7 @@ public function serializeParamsValue($value, $original, $unsaved, $force, $key =

public function jsonSerialize()
{
return $this->toArray(true);
return $this->toArray();
}

/**
Expand Down Expand Up @@ -441,7 +441,7 @@ public function toArray()
*/
public function toJSON()
{
return json_encode($this->toArray(true), JSON_PRETTY_PRINT);
return json_encode($this->toArray(), JSON_PRETTY_PRINT);
}

public function __toString()
Expand Down
2 changes: 1 addition & 1 deletion tests/Stripe/Util/UtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testConvertStripeObjectToArrayIncludesId()
],
null
);
$this->assertTrue(array_key_exists("id", $customer->toArray(true)));
$this->assertTrue(array_key_exists("id", $customer->toArray()));
}

public function testUtf8()
Expand Down

0 comments on commit 106e6f9

Please sign in to comment.