Skip to content

Commit

Permalink
Restoring object parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasmiller committed Feb 21, 2020
1 parent a3f12ea commit 7fad17c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion lib/recurly/pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public function valid(): bool
*/
private function _loadNextPage(): void
{
// TODO: The response should persist the original params, right?
$next_page = $this->_current_page->getNext();
$this->_current_page = $this->_client->nextPage($next_page, null);
}
Expand Down
8 changes: 5 additions & 3 deletions 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 ($key == 'object' || empty($value)) {
if (empty($value)) {
continue;
}

Expand Down Expand Up @@ -134,10 +134,12 @@ function ($item) use ($setter) {
} else {
$klass->$setter($value);
}
} elseif ($key == 'object') {
continue;
} elseif (\Recurly\STRICT_MODE) {
// @codeCoverageIgnoreStart
$klass_name = static::class;
trigger_error("$klass_name encountered json attribute $key but it's unknown to it's schema", E_USER_ERROR);
trigger_error("[STRICT_MODE] $klass_name encountered json attribute $key but it's unknown to it's schema", E_USER_ERROR);
// @codeCoverageIgnoreEnd
}
}
Expand Down Expand Up @@ -193,7 +195,7 @@ protected static function resourceClass(string $type): string
if (!class_exists($klass)) {
// @codeCoverageIgnoreStart
if (\Recurly\STRICT_MODE) {
trigger_error("Could not find the Recurly class for key {$type}", E_USER_ERROR);
trigger_error("[STRICT_MODE] Could not find the Recurly class for key {$type}", E_USER_ERROR);
}
// @codeCoverageIgnoreEnd
}
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

class Version
{
public const CURRENT = '3.0.0-beta2';
public const CURRENT = '3.0.0-beta3';
}

0 comments on commit 7fad17c

Please sign in to comment.