瀏覽代碼

Undefined variable deviceId. Se utilizaba antes de definirla.

Maxi Schvindt 7 年之前
父節點
當前提交
21d7d958c0
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      src/StatsBundle/Command/GenerateRemoteCrontabCommand.php

+ 7 - 7
src/StatsBundle/Command/GenerateRemoteCrontabCommand.php

@@ -94,27 +94,27 @@ class GenerateRemoteCrontabCommand extends ContainerAwareCommand
             foreach ($oltDevices as $device) {
                 $commands = array();
                 $data = $device->jsonExtraData();
+                $deviceId = $device->getDeviceId();
 
                 if ($data['executeSnmp'] == 0){
-		    $content .= PHP_EOL . PHP_EOL . "# Device {$deviceId} skiped, executeSnmp is 0" . PHP_EOL;
+		            $content .= PHP_EOL . PHP_EOL . "# Device {$deviceId} skiped, executeSnmp is 0" . PHP_EOL;
                     continue;
-		}
+		        }   
                 if (!in_array($data['mark'], $oltMarks)){
-		    $content .= PHP_EOL . PHP_EOL . "# Device {$deviceId} skiped, mark is not one of " . implode(", ", $oltMarks). PHP_EOL;
+		            $content .= PHP_EOL . PHP_EOL . "# Device {$deviceId} skiped, mark is not one of " . implode(", ", $oltMarks). PHP_EOL;
                     continue;
-		}
+		        }
 
                 if (!in_array($data['library'], $oltLibraries)){
-		    $content .= PHP_EOL . PHP_EOL . "# Device {$deviceId} skiped, library is not one of " . implode(", ", $oltLibraries). PHP_EOL;
+		            $content .= PHP_EOL . PHP_EOL . "# Device {$deviceId} skiped, library is not one of " . implode(", ", $oltLibraries). PHP_EOL;
                     continue;
-		}
+        		}
 
                 $oltName = $data['name'];
                 $mark = strtolower($data['mark']);
                 $library = $data['library'];
                 $snmpCommunity = $data['snmpCommunity'];
                 $deviceIp = $device->getIp();
-                $deviceId = $device->getDeviceId();
 
                 $timeScan = $data['timeScan'];
                 $timeOnuStats = $data['timeOnuStats'];