Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant code and fix phpDoc #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

00dev
Copy link
Contributor

@00dev 00dev commented Feb 5, 2019

  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).

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 neither 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
Copy link
Contributor Author

00dev commented Feb 5, 2019

It seems point 5 (about getOne()) solves #46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant