Skip to content

Commit

Permalink
Merge pull request #587 from recurly/sim-275-v3-v2019-10-10
Browse files Browse the repository at this point in the history
Replace empty() with is_null()
  • Loading branch information
douglasmiller authored Mar 4, 2021
2 parents ba18ac5 + b2ac288 commit 75dc9d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/recurly/recurly_resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static function cast(object $data): \Recurly\RecurlyResource
{
$klass = new static();
foreach ($data as $key => $value) {
if (empty($value)) {
if (is_null($value)) {
continue;
}

Expand Down
2 changes: 2 additions & 0 deletions tests/RecurlyResource_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public function testUnknownPropertyError(): void
public function testFromJsonValidResource(): void
{
$test_resource = (object)[
"id" => "0",
"object" => "test_resource",
"name" => "test-resource",
"single_child" => (object)[
Expand All @@ -45,6 +46,7 @@ public function testFromJsonValidResource(): void
{
$this->assertInstanceOf(\Recurly\Resources\TestResource::class, $resource);
}
$this->assertEquals($result->getId(), 0);
}

public function testFromJsonNullArray(): void
Expand Down

0 comments on commit 75dc9d7

Please sign in to comment.