refactoring

This commit is contained in:
Roland Gruber 2020-04-29 20:33:43 +02:00
parent 8743285719
commit e44f3d3243
1 changed files with 3 additions and 2 deletions

View File

@ -63,11 +63,12 @@ class Importer {
$entries = array(); $entries = array();
$currentEntry = array(); $currentEntry = array();
foreach ($lines as $line) { foreach ($lines as $line) {
if (substr(trim($line), 0, 1) === '#') { $trimmedLine = trim($line);
if (substr($trimmedLine, 0, 1) === '#') {
// skip comments // skip comments
continue; continue;
} }
if (empty(trim($line))) { if (empty($trimmedLine)) {
// end of entry // end of entry
if (!empty($currentEntry)) { if (!empty($currentEntry)) {
$entries[] = $currentEntry; $entries[] = $currentEntry;