1 | <?php |
||
8 | abstract class BaseExample |
||
9 | { |
||
10 | /** |
||
11 | * The Random.org API bridge. |
||
12 | * |
||
13 | * @var \drupol\Yaroc\RandomOrgAPI |
||
14 | */ |
||
15 | private $randomOrgAPI; |
||
16 | |||
17 | /** |
||
18 | * BaseExample constructor. |
||
19 | */ |
||
20 | public function __construct() |
||
21 | { |
||
22 | $key = '00000000-0000-0000-0000-000000000000'; |
||
23 | if (file_exists('./apikey') && $fileKey = file_get_contents('./apikey')) { |
||
24 | $key = $fileKey; |
||
25 | } |
||
26 | |||
27 | $this->randomOrgAPI = (new RandomOrgAPI([]))->withApiKey($key); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * Get the Random.org API bridge. |
||
32 | * |
||
33 | * @return \drupol\Yaroc\RandomOrgAPI |
||
34 | */ |
||
35 | public function getRandomOrgAPI() |
||
36 | { |
||
37 | return $this->randomOrgAPI; |
||
38 | } |
||
39 | |||
40 | public function getHttpClient() |
||
44 | } |
||
45 |