refactoring
This commit is contained in:
parent
8743285719
commit
e44f3d3243
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue