add( new Report( Report::TYPE_INFO, "The source file contains ${rowCount} rows." ) ); $report->add( new Report( Report::TYPE_INFO, "The source file contains ${columnCount} columns (inferred from first row)." ) ); if (!$columnCountMismatch) { $report->add( new Report( Report::TYPE_INFO, "The source file has the same amount of columns for each row." ) ); } else { $report->add( new Report( Report::TYPE_WARNING, "The source file has not the same amout of columns for each row." ) ); } } else { $report->add( new Report( Report::TYPE_WARNING, "Source file is empty." ) ); } @fclose($sourceFp); $report->setType(Report::TYPE_INFO); $report->setMessage('The script ended gracefully.'); return $report; } }