parsecsv / parsecsv-for-php

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

condition 'is greater than' does not working #179

Closed gardist closed 5 years ago

gardist commented 5 years ago

example with default _books.csv:

$csv = new ParseCsv\Csv();
$csv->conditions = 'rating is greater than 0';
$csv->limit = 3;
$csv->auto('examples/_books.csv');
print_r($csv->data);

return:

Array
(
)

fix issue:

Array
(
    [0] => Array
        (
            [rating] => 3
            [title] => The Last Templar
            [author] => Raymond Khoury
            [type] => Book
            [asin] => 0752880705
            [tags] => 
            [review] => 
        )

    [1] => Array
        (
            [rating] => 5
            [title] => The Traveller
            [author] => John Twelve Hawks
            [type] => Book
            [asin] => 059305430X
            [tags] => 
            [review] => 
        )

    [2] => Array
        (
            [rating] => 4
            [title] => Crisis Four
            [author] => Andy Mcnab
            [type] => Book
            [asin] => 0345428080
            [tags] => 
            [review] => 
        )
)

how I fixed that: (https://github.com/gardist/parsecsv-for-php/commit/d2ef517854a496ad83c2561bd0bb18610826e39b)

gogowitsch commented 4 years ago

I just verified that the problem described in is issue is indeed fixed.