-
-
Notifications
You must be signed in to change notification settings - Fork 142
PhpStan fixes #364
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
base: master
Are you sure you want to change the base?
PhpStan fixes #364
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,8 @@ public function __construct(\mysqli_result $resultSet, bool $buffered) | |
| */ | ||
| public function __destruct() | ||
| { | ||
| if ($this->autoFree && $this->getResultResource()) { | ||
| if ($this->autoFree) { | ||
| $this->getResultResource(); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changes behavior
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is right. |
||
| @$this->free(); | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,7 +154,7 @@ public function translate(array $args): string | |
| $sql = trim(implode(' ', $sql), ' '); | ||
|
|
||
| if ($this->errors) { | ||
| throw new Exception('SQL translate error: ' . trim(reset($this->errors), '*'), 0, $sql); | ||
| throw new Exception('SQL translate error: ' . trim((string) reset($this->errors), '*'), 0, $sql); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it changes behavior, can be null or empty array. And original code is correct.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I reverted original condition but kept
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For nonempty |
||
| } | ||
|
|
||
| // apply limit | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no reason for this change, in_array checks type
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter
$codecan beintorstring. In the case ofstringtheifstatements can be skipped (better performance and code readability).What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in mysql driver it is always int.