Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
Added some comments and a small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiegant committed May 13, 2020
1 parent d15f0c4 commit e6f52bb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Response/BaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,20 @@ protected function parseParameter(
}

/**
* Is this an error.
*
* @return bool
*/
public function isError(): bool
{
return $this->error;
}

/**
* Return the response as an Array.
*
* @return array
*/
public function asArray(): array
{
// Get the variables of the current class
Expand All @@ -124,7 +131,7 @@ public function asArray(): array
$result = [];

// Traverse the class properties
foreach ($classProperties as $classProperty) {
foreach ($classProperties as $classProperty => $value) {
if ($classProperty !== 'casts') {
// Add them to the result
$result[$classProperty] = $this->$classProperty;
Expand Down

0 comments on commit e6f52bb

Please sign in to comment.