Issues (6)

example/example.php (1 issue)

Severity
1
<?php
2
require __DIR__ . "/../vendor/autoload.php";
3
4
use \ElePHPant\Quotation\Quotation;
5
use \ElePHPant\Quotation\Generic;
6
use \ElePHPant\Quotation\Currencies\USDollar;
7
8
$dollar = (new USDollar(Quotation::RESPONSE_JSON));
9
10
var_dump([
11
    "DOLLAR_TODAY" => $dollar->today(),
12
    "DOLLAR_IN_PERIOD"=>$dollar->period(7),
13
    "DOLLAR_IN_INTERVAL"=>$dollar->interval(new DateTime("2020-01-05"), new DateTime("now"))
14
]);
15
16
17
//Fetch Status from several Currencies in same Time
18
$generic = (new Generic([
19
    Quotation::CURRENCY_RIPPLE,
20
    Quotation::CURRENCY_BITCOIN,
21
    Quotation::CURRENCY_SWISS_FRANC
22
]))->quote();
23
24
var_dump($generic);
25
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...