I would have written:

```php
while (count($result) < $limit && $line = $this->readLineFromFile($file)) {
```