for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace eXpansion\Framework\GameTrackmania\DataProviders;
use eXpansion\Framework\Core\DataProviders\AbstractDataProvider;
use eXpansion\Framework\Core\DataProviders\MethodScriptDataProviderInterface;
use eXpansion\Framework\Core\ScriptMethods\AbstractScriptMethod;
use Maniaplanet\DedicatedServer\Connection;
/**
* Class MethodGetStoresDataProvider
*
* @author de Cramer Oliver<[email protected]>
* @copyright 2017 Smile
* @package eXpansion\Framework\GameManiaplanet\DataProviders
*/
class MethodGetScoresDataProvider extends AbstractDataProvider implements MethodScriptDataProviderInterface
{
/** @var Connection */
protected $connection;
* MethodGetStoresDataProvider constructor.
* @param Connection $connection
public function __construct(Connection $connection)
$this->connection = $connection;
}
* @inheritdoc
* @param string $pluginId
* @param AbstractScriptMethod $pluginService
public function registerPlugin($pluginId, $pluginService)
parent::registerPlugin($pluginId, $pluginService);
$pluginService->setCurrentDataProvider($this);
* Request call to fetch scores.
* @return null
public function request()
$this->connection->triggerModeScriptEvent('TriggerModeScriptEventArray', ['Trackmania.GetScores'], [(string)time()]);
array((string) time())
array<integer,string,{"0":"string"}>
boolean
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);
* Set scores.
* @param array $params
public function setScores($params)
$this->dispatch('setScores', [$params]);
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: