Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/Resources/ApiResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use CoinbaseCommerce\ApiClient;
use CoinbaseCommerce\ApiResponse;
use CoinbaseCommerce\Util;
use PhpOffice\PhpSpreadsheet\Worksheet\Iterator;

class ApiResource extends \ArrayObject
{
Expand Down Expand Up @@ -122,12 +123,12 @@ public function __toString()
return print_r($this->attributes, true);
}

public static function setClient($client)
public static function setClient($client): void
{
self::$client = $client;
}

protected static function getClient()
protected static function getClient(): mixed
{
if (self::$client) {
return self::$client;
Expand All @@ -136,37 +137,37 @@ protected static function getClient()
return ApiClient::getInstance();
}

public function offsetGet($key)
public function offsetGet($key): mixed
{
return $this->__get($key);
}

public function offsetSet($key, $value)
public function offsetSet($key, $value): void
{
null === $key ? array_push($this->attributes, $value) : $this->attributes[$key] = $value;
}

public function count()
public function count(): int
{
return count($this->attributes);
}

public function asort()
public function asort(int $flags=SORT_REGULAR): bool
{
asort($this->attributes);
}

public function ksort()
public function ksort(int $flags=SORT_REGULAR): bool
{
ksort($this->attributes);
}

public function offsetUnset($key)
public function offsetUnset($key): void
{
unset($this->attributes[$key]);
}

public function getIterator()
public function getIterator(): Iterator
{
return new \ArrayIterator($this->attributes);
}
Expand Down