Skip to content

Commit

Permalink
all "&=" replaced with "= $returnValue &&"
Browse files Browse the repository at this point in the history
  • Loading branch information
Brovning committed Feb 26, 2022
1 parent 32088b7 commit 80521e6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions libs/myFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private function deleteInstanceNotInUse(int $connectionId_Old, string $moduleId)
// Loesche Connection-Instanz (bspw. ModbusAddress, ClientSocket,...), wenn nicht mehr in Verwendung
if (!$inUse)
{
$returnValue &= IPS_DeleteInstance($connectionId_Old);
$returnValue = $returnValue && IPS_DeleteInstance($connectionId_Old);
}
}

Expand Down Expand Up @@ -352,24 +352,24 @@ private function createVarProfile(string $ProfilName, int $ProfileType, string $

if (!IPS_VariableProfileExists($ProfilName))
{
$returnValue &= IPS_CreateVariableProfile($ProfilName, $ProfileType);
$returnValue &= IPS_SetVariableProfileText($ProfilName, '', $Suffix);
$returnValue = $returnValue && IPS_CreateVariableProfile($ProfilName, $ProfileType);
$returnValue = $returnValue && IPS_SetVariableProfileText($ProfilName, '', $Suffix);

if (in_array($ProfileType, array(VARIABLETYPE_INTEGER, VARIABLETYPE_FLOAT)))
{
$returnValue &= IPS_SetVariableProfileValues($ProfilName, $MinValue, $MaxValue, $StepSize);
$returnValue &= IPS_SetVariableProfileDigits($ProfilName, $Digits);
$returnValue = $returnValue && IPS_SetVariableProfileValues($ProfilName, $MinValue, $MaxValue, $StepSize);
$returnValue = $returnValue && IPS_SetVariableProfileDigits($ProfilName, $Digits);
}

$returnValue &= IPS_SetVariableProfileIcon($ProfilName, $Icon);
$returnValue = $returnValue && IPS_SetVariableProfileIcon($ProfilName, $Icon);

foreach ($Associations as $a)
{
$w = isset($a['Wert']) ? $a['Wert'] : '';
$n = isset($a['Name']) ? $a['Name'] : '';
$i = isset($a['Icon']) ? $a['Icon'] : '';
$f = isset($a['Farbe']) ? $a['Farbe'] : -1;
$returnValue &= IPS_SetVariableProfileAssociation($ProfilName, $w, $n, $i, $f);
$returnValue = $returnValue && IPS_SetVariableProfileAssociation($ProfilName, $w, $n, $i, $f);
}

$this->SendDebug("Variable-Profile", "Profile ".$ProfilName." created", 0);
Expand All @@ -392,7 +392,7 @@ private function deleteModbusInstancesRecursive(array $inverterModelRegister_arr
$instanceId = @IPS_GetObjectIDByIdent($register[IMR_START_REGISTER].$uniqueIdent, $categoryId);
if (false !== $instanceId)
{
$returnValue &= $this->deleteInstanceRecursive($instanceId);
$returnValue = $returnValue && $this->deleteInstanceRecursive($instanceId);

$this->SendDebug("delete Modbus address", "REG_".$register[IMR_START_REGISTER]." - ".$register[IMR_NAME].", ID=".$instanceId, 0);
}
Expand All @@ -406,9 +406,9 @@ private function deleteInstanceRecursive(int $instanceId): bool
$returnValue = true;
foreach (IPS_GetChildrenIDs($instanceId) as $childChildId)
{
$returnValue &= IPS_DeleteVariable($childChildId);
$returnValue = $returnValue && IPS_DeleteVariable($childChildId);
}
$returnValue &= IPS_DeleteInstance($instanceId);
$returnValue = $returnValue && IPS_DeleteInstance($instanceId);

return (bool)$returnValue;
}
Expand Down

1 comment on commit 80521e6

@Brovning
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#20 Uncaught TypeError: deleteInstanceNotInUse()

Please sign in to comment.