parsecsv / parsecsv-for-php

CSV data parser for PHP.
MIT License
681 stars 176 forks source link

Fixing deprecated parse() to be parseFile() #211

Closed ridwaanzan closed 1 year ago

ridwaanzan commented 2 years ago

i got this error when using laravel 7.x, and got error message. so, i'm changin it and it works fine in my local.

jimeh commented 2 years ago

I believe this change would break support for constructing a parser with some CSV-style data.

The $data argument has a deprecation warning:

WARNING: Supplying file paths here is
deprecated. Use parseFile() instead

So in your case, to avoid the deprecation warning, pass in a null data value when constructing the parser, then call parseFile() giving it the path to the file to parse instead.

ridwaanzan commented 2 years ago

I believe this change would break support for constructing a parser with some CSV-style data.

The $data argument has a deprecation warning:

WARNING: Supplying file paths here is
deprecated. Use parseFile() instead

So in your case, to avoid the deprecation warning, pass in a null data value when constructing the parser, then call parseFile() giving it the path to the file to parse instead.

wow, thank you very much Sir. i will try your suggestion