Skip to content

Commit

Permalink
changed syntax to support PHP version 5.6+
Browse files Browse the repository at this point in the history
  • Loading branch information
swar8080 committed Aug 21, 2018
1 parent 3608e96 commit ca8095b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/exceptions/FastStockQuotesException.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class FastStockQuotesException extends \Exception{

private $failedSymbols;

public function __construct( $message = "", $code = 0, Throwable $previous = null, $stockSymbols=null ) {
public function __construct( $message = "", $code = 0, $previous = null, $stockSymbols=null ) {
$this->failedSymbols = $stockSymbols;

if ($stockSymbols !== null){
Expand Down
6 changes: 4 additions & 2 deletions src/markets/StockExchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,15 @@ public function timestampOfLastClose(){
}
else {
//return yesterday's close
return ($closingTimeToday->sub(new \DateInterval("P1D")))->getTimestamp();
$yesterdayClose = $closingTimeToday->sub(new \DateInterval("P1D"));
return $yesterdayClose->getTimestamp();
}
}
else {
//get friday's close time
$daysSinceFridayInterval = "P" . strval($dayOfWeek - 5) . "D";
return ($closingTimeToday->sub(new \DateInterval($daysSinceFridayInterval)))->getTimestamp();
$fridayClose = $closingTimeToday->sub(new \DateInterval($daysSinceFridayInterval));
return $fridayClose->getTimestamp();
}
}

Expand Down

0 comments on commit ca8095b

Please sign in to comment.