Fix linting
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
class CsvReader {
|
||||
class CsvReader
|
||||
{
|
||||
private $file;
|
||||
// private array $headers;
|
||||
|
||||
@@ -10,11 +11,10 @@ class CsvReader {
|
||||
|
||||
public function __construct(
|
||||
public string $filename,
|
||||
)
|
||||
{
|
||||
$this->file = fopen($filename, "r");
|
||||
if (!$this->file) {
|
||||
throw new \RuntimeException("Failed to open file: " . $filename);
|
||||
) {
|
||||
$this->file = fopen($filename, 'r');
|
||||
if (! $this->file) {
|
||||
throw new \RuntimeException('Failed to open file: '.$filename);
|
||||
}
|
||||
|
||||
// $this->headers = $this->readNextLine();
|
||||
@@ -22,9 +22,10 @@ class CsvReader {
|
||||
|
||||
public function readNextLine(): ?array
|
||||
{
|
||||
if (($data = fgetcsv($this->file, 1000, ",")) !== FALSE) {
|
||||
if (($data = fgetcsv($this->file, 1000, ',')) !== false) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
return null; // End of file or error
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user