Skip to content

Commit

Permalink
fixed problems with nonexists array keys
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Mar 1, 2018
1 parent ffccf5c commit 3f1e753
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/KrakenServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ protected function registerClient(): void

return new Client(
new HttpClient(),
$config['key'] ?: null,
$config['secret'] ?: null,
$config['otp'] ?: null
$config['key'] ?? null,
$config['secret'] ?? null,
$config['otp'] ?? null
);
});
}
Expand Down
8 changes: 4 additions & 4 deletions src/Objects/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,31 @@ public function id(): string
*/
public function status()
{
return $this->information['status'] ?: null;
return $this->information['status'] ?? null;
}

/**
* @return float
*/
public function volume(): float
{
return $this->information['vol'] ?: 0.0;
return $this->information['vol'] ?? 0.0;
}

/**
* @return float
*/
public function price(): float
{
return $this->information['price'] ?: 0.0;
return $this->information['price'] ?? 0.0;
}

/**
* @return float
*/
public function cost(): float
{
return $this->information['cost'] ?: 0.0;
return $this->information['cost'] ?? 0.0;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Objects/OrderStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function __construct(string $transactionId, array $descriptions = [])
$this->transactionId = $transactionId;

$this->description = new OrderStatusDescription(
$descriptions['order'] ?: null,
$descriptions['close'] ?: null
$descriptions['order'] ?? null,
$descriptions['close'] ?? null
);
}

Expand Down

0 comments on commit 3f1e753

Please sign in to comment.