public function __construct($extraParams) { if ($this->isJson($extraParams)) { $this->extraParams = json_decode($extraParams, true); } else { $this->extraParams = (array) $extraParams; } }