From c4e246f662482fa9410a57a650223e7e2b69f81d Mon Sep 17 00:00:00 2001 From: thibdrev Date: Fri, 19 Jan 2024 14:39:34 +0100 Subject: [PATCH] qual:phpstan htdocs/cron/card.php 144 Property Cronjob::$frequency (int) does not accept array|string. htdocs/cron/card.php 145 Property Cronjob::$maxrun (int) does not accept array|string. htdocs/cron/card.php 163 Property CommonObject::$id (int) does not accept array|string. htdocs/cron/card.php 179 Property Cronjob::$frequency (int) does not accept array|string. htdocs/cron/card.php 180 Property Cronjob::$maxrun (int) does not accept array|string. --- htdocs/cron/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 30dd8e920a8..3a1298f271f 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php'; // Load translation files required by the page $langs->loadLangs(array('admin', 'cron', 'members', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); @@ -141,8 +141,8 @@ if ($action == 'add' && $permissiontoadd) { $object->priority = GETPOST('priority', 'int'); $object->datenextrun = dol_mktime(GETPOST('datenextrunhour', 'int'), GETPOST('datenextrunmin', 'int'), 0, GETPOST('datenextrunmonth', 'int'), GETPOST('datenextrunday', 'int'), GETPOST('datenextrunyear', 'int')); $object->unitfrequency = GETPOST('unitfrequency', 'int'); - $object->frequency = GETPOST('nbfrequency', 'int'); - $object->maxrun = GETPOST('maxrun', 'int'); + $object->frequency = GETPOSTINT('nbfrequency'); + $object->maxrun = GETPOSTINT('maxrun'); $object->email_alert = GETPOST('email_alert'); // Add cron task @@ -176,8 +176,8 @@ if ($action == 'update' && $permissiontoadd) { $object->priority = GETPOST('priority', 'int'); $object->datenextrun = dol_mktime(GETPOST('datenextrunhour', 'int'), GETPOST('datenextrunmin', 'int'), 0, GETPOST('datenextrunmonth', 'int'), GETPOST('datenextrunday', 'int'), GETPOST('datenextrunyear', 'int')); $object->unitfrequency = GETPOST('unitfrequency', 'int'); - $object->frequency = GETPOST('nbfrequency', 'int'); - $object->maxrun = GETPOST('maxrun', 'int'); + $object->frequency = GETPOSTINT('nbfrequency'); + $object->maxrun = GETPOSTINT('maxrun'); $object->email_alert = GETPOST('email_alert'); // Add cron task