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);
array()
array
null|object<Http\Client\HttpClient>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
* Get the Random.org API bridge.
* @return \drupol\Yaroc\RandomOrgAPI
public function getRandomOrgAPI()
return $this->randomOrgAPI;
public function getHttpClient()
return new Client();
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: