chrisboulton / php-resque

PHP port of resque (Workers and Queueing)
MIT License
3.43k stars 759 forks source link

Why not "break"? #377

Open d-a-gerashenko opened 5 years ago

d-a-gerashenko commented 5 years ago

https://github.com/chrisboulton/php-resque/blob/968b7e6a307a2079051dfc571d2fc2be0546209f/lib/Resque.php#L307 https://github.com/chrisboulton/php-resque/blob/968b7e6a307a2079051dfc571d2fc2be0546209f/lib/Resque.php#L298

Isn't "break" more appropriate than "$finished" variable?

danhunsaker commented 5 years ago

Even better than while(true) and break; would be to move the $string = lines into the while() condition, and remove the if checks entirely. I'd accept a PR at the new repo (https://github.com/resque/php-resque) to apply this change.

I'm assuming it was a stylistic choice to write it the current way in the original PR that added this function.