safemysql icon indicating copy to clipboard operation
safemysql copied to clipboard

Remove redundant code and fix phpDoc

Open 00dev opened this issue 6 years ago • 1 comments

  1. Method rawQuery() can't return false because method error() can't return any result (it throws an exception or triggers error);
  2. As rawQuery() always returns truthy value if ($res = $this->rawQuery())... construction is no sense;
  3. mysqli_fetch_array() can't return FALSE. It returns array or NULL;
  4. As fetch() returns array or NULL getRow() also returns array or NULL;
  5. getOne() doesn't free resultset if the query have empty result (not sure if it's bad, but I think it might be better if we clean all resources after method calling).

00dev avatar Feb 05 '19 10:02 00dev

It seems point 5 (about getOne()) solves https://github.com/colshrapnel/safemysql/issues/46

00dev avatar Feb 05 '19 12:02 00dev