Apply fixes from StyleCI (#12121)

This commit is contained in:
Jellyfrog
2020-09-21 15:43:38 +02:00
committed by GitHub
parent 82f43cb98d
commit 2fc3a21211
338 changed files with 2895 additions and 2969 deletions

View File

@@ -1,33 +1,33 @@
<?php
// Set Entity state
foreach (dbFetch('SELECT * FROM `entPhysical_state` WHERE `device_id` = ?', array($device['device_id'])) as $entity) {
if (!isset($entPhysical_state[$entity['entPhysicalIndex']][$entity['subindex']][$entity['group']][$entity['key']])) {
foreach (dbFetch('SELECT * FROM `entPhysical_state` WHERE `device_id` = ?', [$device['device_id']]) as $entity) {
if (! isset($entPhysical_state[$entity['entPhysicalIndex']][$entity['subindex']][$entity['group']][$entity['key']])) {
dbDelete(
'entPhysical_state',
'`device_id` = ? AND `entPhysicalIndex` = ? AND `subindex` = ? AND `group` = ? AND `key` = ?',
array(
[
$device['device_id'],
$entity['entPhysicalIndex'],
$entity['subindex'],
$entity['group'],
$entity['key']
)
$entity['key'],
]
);
} else {
if ($entPhysical_state[$entity['entPhysicalIndex']][$entity['subindex']][$entity['group']][$entity['key']] != $entity['value']) {
echo 'no match!' . ' ' . $entity['entPhysicalIndex'] . ' ' . $entity['subindex'] . ' ' . $entity['key'] . ': ' . $entPhysical_state[$entity['entPhysicalIndex']][$entity['subindex']][$entity['group']][$entity['key']] . ' ' . $entity['value'] . "\n";
dbUpdate(
array('value' => $entPhysical_state[$entity['entPhysicalIndex']][$entity['subindex']][$entity['group']][$entity['key']]),
['value' => $entPhysical_state[$entity['entPhysicalIndex']][$entity['subindex']][$entity['group']][$entity['key']]],
'entPhysical_state',
'`device_id` = ? AND `entPhysicalIndex` = ? AND `subindex` = ? AND `group` = ? AND `key` = ?',
array(
$device['device_id'],
$entity['entPhysicalIndex'],
$entity['subindex'],
$entity['group'],
$entity['key']
)
[
$device['device_id'],
$entity['entPhysicalIndex'],
$entity['subindex'],
$entity['group'],
$entity['key'],
]
);
}
@@ -37,11 +37,11 @@ foreach (dbFetch('SELECT * FROM `entPhysical_state` WHERE `device_id` = ?', arra
// End Set Entity Attrivs
// Delete Entity state
foreach ((array)$entPhysical_state as $epi => $entity) {
foreach ((array) $entPhysical_state as $epi => $entity) {
foreach ($entity as $subindex => $si) {
foreach ($si as $group => $ti) {
foreach ($ti as $key => $value) {
dbInsert(array('device_id' => $device['device_id'], 'entPhysicalIndex' => $epi, 'subindex' => $subindex, 'group' => $group, 'key' => $key, 'value' => $value), 'entPhysical_state');
dbInsert(['device_id' => $device['device_id'], 'entPhysicalIndex' => $epi, 'subindex' => $subindex, 'group' => $group, 'key' => $key, 'value' => $value], 'entPhysical_state');
}
}
}