Passed
Pull Request — master (#2)
by
unknown
07:16
created

getAuthSecret()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
declare(strict_types=1);
3
error_reporting(E_ALL);
4
ini_set('display_errors', '1');
5
6
7
// Load Composer
8
require_once dirname(__DIR__) . '/vendor/autoload.php';
9
10
// Load params from Dotenv
11
$dotenv = new Dotenv\Dotenv(dirname(__DIR__));
12
$dotenv->load();
13
14
function getAuthKey(): string
15
{
16
    return (string)getenv('AUTH_KEY');
17
}
18
19
function getAuthSecret(): string
20
{
21
    return (string)getenv('AUTH_SECRET');
22
}
23
24
function getBaseCurrency(): string
25
{
26
    return (string)(getenv('BASE_CURRENCY') ?? 'USD');
27
}
28
29
/**
30
 * Simulates wallets in your application, used to create an bill (invoice)
31
 * Uses only BTC, ETH, USDT-ETH currencies
32
 * @return array
33
 */
34
function getWallets(): array
35
{
36
    return [
37
        'BTC' => (int)getenv('BTC'),
38
        'ETH' => (int)getenv('ETH'),
39
        'USDT-ETH' => (int)getenv('USDT-ETH'),
40
    ];
41
}
42
43
function getVwId(): ?int {
44
    return (int)getenv('VW_ID');
45
}
46
47
function getVwCurrency(): ?string {
48
    return (string)getenv('VW_CURRENCY');
49
}
50