for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace drupol\Yaroc\Examples;
use drupol\Yaroc\RandomOrgAPI;
use Http\Adapter\Guzzle6\Client;
abstract class BaseExample
{
/**
* The Random.org API bridge.
*
* @var \drupol\Yaroc\RandomOrgAPI
*/
private $randomOrgAPI;
* BaseExample constructor.
public function __construct()
$key = '00000000-0000-0000-0000-000000000000';
if (file_exists('./apikey') && $fileKey = file_get_contents('./apikey')) {
$key = $fileKey;
}
$this->randomOrgAPI = (new RandomOrgAPI([]))->withApiKey($key);
* Get the Random.org API bridge.
* @return \drupol\Yaroc\RandomOrgAPI
public function getRandomOrgAPI()
return $this->randomOrgAPI;
public function getHttpClient()
return new Client();