Skip to content

Commit 5fbf370

Browse files
author
Andrey Helldar
authored
Merge pull request #88 from cashier-provider/andrey-helldar-patch-1
CashierProvider\Core\Helpers\JSON::decode(): Return value must be of type array, string returned
2 parents b003faa + 1d70bd0 commit 5fbf370

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Helpers/JSON.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function decode(?string $encoded): array
4343

4444
$decoded = json_decode($encoded, true) ?: [];
4545

46-
return $this->doesntError() ? $decoded : $this->parseErrors($encoded);
46+
return $this->doesntError() ? (array) $decoded : $this->parseErrors($encoded);
4747
}
4848

4949
protected function doesntError(): bool

src/Services/Driver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function __construct(DriverConfig $config, Model $payment)
7070
public function statuses(): Statuses
7171
{
7272
return $this->resolveDynamicCallback($this->statuses, function (string $statuses) {
73-
/** @var \DragonCode\Contracts\Cashier\Helpers\Statuses|string $statuses */
73+
// @var \DragonCode\Contracts\Cashier\Helpers\Statuses|string $statuses
7474
return $statuses::make($this->payment);
7575
});
7676
}

0 commit comments

Comments
 (0)