Skip to content

Commit e12ccf6

Browse files
author
Jacob Davis
committed
Leaving symbols blank fetches all symbols
1 parent 6b381d4 commit e12ccf6

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "oneforge/forexquotes",
33
"type": "library",
4-
"version": "2.0.3",
4+
"version": "2.0.4",
55
"description": "Library to fetch and parse realtime Forex quotes and convert currencies",
66
"keywords": [
77
"forex",

lib/ForexDataClient.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,16 @@ public function getSymbols()
4343
return json_decode($body, true);
4444
}
4545

46-
public function getQuotes(array $symbols)
46+
public function getQuotes(array $symbols = null)
4747
{
48-
$pairs = implode(",", $symbols);
49-
$body = $this->fetch('quotes?pairs=' . $pairs);
48+
if ($symbols === null)
49+
{
50+
$body = $this->fetch('quotes?cache=false');
51+
}
52+
else{
53+
$pairs = implode(",", $symbols);
54+
$body = $this->fetch('quotes?pairs=' . $pairs);
55+
}
5056

5157
$quotes = json_decode($body);
5258

0 commit comments

Comments
 (0)