class OnePoll
{
- public static function execute($contact_id = 0, $command = '')
+ public static function execute(int $contact_id = 0, string $command = '')
{
Logger::notice('Start polling/probing contact', ['id' => $contact_id]);
- $force = ($command == "force");
+ $force = ($command == 'force');
if (empty($contact_id)) {
Logger::notice('no contact provided');
*
* @param array $contact The personal contact entry
* @param array $fields The fields that are updated
+ * @return void
* @throws \Exception
*/
private static function updateContact(array $contact, array $fields)
}
$cookiejar = tempnam(System::getTempPath(), 'cookiejar-onepoll-');
- $curlResult = DI::httpClient()->get($contact['poll'], [HttpClientOptions::COOKIEJAR => $cookiejar, HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::FEED_XML]);
+ $curlResult = DI::httpClient()->get($contact['poll'], HttpClientAccept::FEED_XML, [HttpClientOptions::COOKIEJAR => $cookiejar]);
unlink($cookiejar);
if ($curlResult->isTimeout()) {