Skip to content

Commit 98e99ed

Browse files
committed
Fix multiple PHPStan issues and update baseline
1 parent 2ca8716 commit 98e99ed

30 files changed

+86
-61
lines changed

core/ajax/cache.ajax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
if (init('action') == 'set') {
3030
unautorizedInDemo();
31-
cache::set(init('key'), init('value'), init('lifetime', 0), init('options', null));
31+
cache::set(init('key'), init('value'), init('lifetime', 0));
3232
ajax::success();
3333
}
3434

core/ajax/cmd.ajax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@
465465
$data[] = $info_history;
466466
}
467467
} else {
468-
$histories = history::getHistoryFromCalcul(jeedom::fromHumanReadable(init('id')), $dateStart, $dateEnd, init('allowZero', false), init('groupingType'), init('addFirstPreviousValue', false));
468+
$histories = history::getHistoryFromCalcul(jeedom::fromHumanReadable(init('id')), $dateStart, $dateEnd, init('allowZero', false), init('groupingType'));
469469
if (is_array($histories)) {
470470
foreach ($histories as $datetime => $value) {
471471
$info_history = array();

core/ajax/eqLogic.ajax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@
541541
$eqLogicsSave = json_decode($eqLogicSaves, true);
542542
$nbrSave = count($eqLogicsSave);
543543
$return = array();
544-
544+
$eqLogic = null;
545545
foreach ($eqLogicsSave as $eqLogicSave) {
546546

547547
if (!is_array($eqLogicSave)) {

core/ajax/interact.ajax.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
$results = utils::o2a(interactDef::all());
3131
foreach ($results as &$result) {
3232
$result['nbInteractQuery'] = count(interactQuery::byInteractDefId($result['id']));
33-
$result['nbEnableInteractQuery'] = count(interactQuery::byInteractDefId($result['id'], true));
33+
$result['nbEnableInteractQuery'] = count(interactQuery::byInteractDefId($result['id']));
3434
if (isset($result['link_type']) && $result['link_type'] == 'cmd' && $result['link_id'] != '') {
3535
$link_id = '';
3636
foreach (explode('&&', $result['link_id']) as $cmd_id) {
@@ -49,7 +49,7 @@
4949
if (init('action') == 'byId') {
5050
$result = utils::o2a(interactDef::byId(init('id')));
5151
$result['nbInteractQuery'] = count(interactQuery::byInteractDefId($result['id']));
52-
$result['nbEnableInteractQuery'] = count(interactQuery::byInteractDefId($result['id'], true));
52+
$result['nbEnableInteractQuery'] = count(interactQuery::byInteractDefId($result['id']));
5353
ajax::success(jeedom::toHumanReadable($result));
5454
}
5555

core/ajax/listener.ajax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
}
4444

4545
if (init('action') == 'all') {
46-
$listeners = utils::o2a(listener::all(true));
46+
$listeners = utils::o2a(listener::all());
4747
foreach ($listeners as &$listener) {
4848
$listener['event_str'] = '';
4949
foreach ($listener['event'] as $event) {

core/ajax/object.ajax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ function jeeAjax_objectToHtml($_id = -1, $_version = 'dashboard', $_category = '
231231
if (!isConnect('admin')) {
232232
throw new Exception(__('401 - Accès non autorisé', __FILE__));
233233
}
234-
ajax::success(jeeObject::getUISelectList(init('none'), true));
234+
ajax::success(jeeObject::getUISelectList(init('none')));
235235
}
236236

237237
if (init('action') == 'getSummaryHtml') {

core/ajax/queue.ajax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
}
4444

4545
if (init('action') == 'all') {
46-
$queues = queue::all(true);
46+
$queues = queue::all();
4747
foreach ($queues as $queue) {
4848
$queue->refresh();
4949
}

core/ajax/report.ajax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
foreach (ls($path, '*') as $value) {
6262
unlink($path . $value);
6363
}
64-
ajax::success($return);
64+
ajax::success();
6565
}
6666

6767
throw new Exception(__('Aucune méthode correspondante à :', __FILE__) . ' ' . init('action'));

core/ajax/scenario.ajax.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
if (init('action') == 'applyTemplate') {
184184
unautorizedInDemo();
185185
$path = __DIR__ . '/../../data/scenario';
186+
$converts = [];
186187
if (!file_exists($path . '/' . init('template'))) {
187188
throw new Exception(__('Fichier non trouvé :', __FILE__) . ' ' . $path . '/' . init('template'));
188189
}

core/ajax/user.ajax.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
if (!isConnect()) {
3939
if (config::byKey('sso:allowRemoteUser') == 1) {
40+
$configs = config::byKeys(array('session_lifetime', 'sso:allowRemoteUser', 'sso:remoteUserHeader'));
4041
$header = $configs['sso:remoteUserHeader'];
4142
$header_value = $_SERVER[$header];
4243
$user = user::byLogin($header_value);
@@ -343,7 +344,8 @@
343344

344345
if (init('action') == 'removeBanIp') {
345346
unautorizedInDemo();
346-
ajax::success(user::removeBanIp());
347+
user::removeBanIp();
348+
ajax::success();
347349
}
348350

349351
if (init('action') == 'supportAccess') {

0 commit comments

Comments
 (0)