code: public function getLineCount(): int
      {
          $ret = 0;
          $fh = fopen($this->path, "r");
          while (!feof($fh)) {
              $buffer = fread($fh, 8192);
              $ret += substr_count($buffer, PHP_EOL);
          }
          fclose($fh);
          return $ret;
      }
docs: Get the number of lines in the file
  
  @return int