mavinoo / laravelBatch

insert batch and update batch in laravel
MIT License
564 stars 118 forks source link

syntax error, unexpected 'return' (T_RETURN) #87

Closed tanero closed 2 years ago

tanero commented 2 years ago

When I try to run Batch:update method, error message shown like below;

Laravel Framework 8.83.9

ParseError                                                                                                            

  syntax error, unexpected 'return' (T_RETURN)                                                                           

  at C:\www\myapp\vendor\mavinoo\laravel-batch\src\Batch.php:275
    271▕     {                                                                                                           
    272▕         // no need for the old validation since we now use type hint that supports from php 7.0                 
    273▕         // but I kept this one                                                                                  
    274▕         if (count($columns) !== count(current($values)) {
  ➜ 275▕             return false;
    276▕         }
    277▕
    278▕         $query = [];
    279▕         $minChunck = 100;
nguyenbinhit commented 2 years ago

You just need to add ')' as follows. This bug has been fixed, but for some reason it hasn't been updated yet:

if (count($columns) !== count(current($values))) {
    return false;
}
mavinoo commented 2 years ago

hi @tanero @nguyenbinhit fixed syntax error issues 86 reinstall package

tanero commented 2 years ago

hi @tanero @nguyenbinhit fixed syntax error issues 86 reinstall package

@nguyenbinhit @mavinoo @YuzuruS

I have checked the git history, the issue had been fixed by mavinio at version 2.3.2

but code changed at version 2.3.3 by YuzuruS but missing parantheses.

https://github.com/mavinoo/laravelBatch/commit/2c814b5387f02bd8441f0aaf5b53fd2135efa756