Code cleanup, no functional changes

This commit is contained in:
2023-06-27 19:39:11 +12:00
parent b70a36003a
commit ad36da0bb1
64 changed files with 466 additions and 438 deletions

View File

@@ -109,7 +109,7 @@ class NodelistImport implements ShouldQueue
$tocrc .= $line."\r\n";
// Lines beginning with a semicolon(;) are comments
if ((! $line) OR preg_match('/^;/',$line) OR ($line == chr(0x1a)))
if ((! $line) OR preg_match('/^;/',$line) OR ($line === chr(0x1a)))
continue;
// Remove any embedded CR and BOM
@@ -365,7 +365,7 @@ class NodelistImport implements ShouldQueue
try {
$so->addresses()->save($ao);
if ($ao->role == Address::NODE_HC)
if ($ao->role === Address::NODE_HC)
$hub_id = $ao->id;
$no->addresses()->attach($ao,['role'=>$ao->role]);
@@ -387,7 +387,7 @@ class NodelistImport implements ShouldQueue
Address::whereIN('id',$remove->pluck('id')->toArray())->update(['active'=>FALSE]);
Address::whereIN('id',$remove->pluck('id')->toArray())->delete();
if ($x=crc16(substr($tocrc,0,-3)) == $file_crc) {
if ($x=crc16(substr($tocrc,0,-3)) === $file_crc) {
Log::info(sprintf('%s:Committing nodelist',self::LOGKEY));
DB::commit();
} else {