Open
Conversation
Merged
dg
reviewed
May 7, 2020
dg
reviewed
May 7, 2020
dg
reviewed
May 7, 2020
| if ($this->errors) { | ||
| throw new Exception('SQL translate error: ' . trim(reset($this->errors), '*'), 0, $sql); | ||
| if ($this->errors !== []) { | ||
| throw new Exception('SQL translate error: ' . trim((string) reset($this->errors), '*'), 0, $sql); |
Owner
There was a problem hiding this comment.
it changes behavior, can be null or empty array. And original code is correct.
Contributor
Author
There was a problem hiding this comment.
I reverted original condition but kept (string) for PhpStan because function reset() can return mixed value.
Owner
There was a problem hiding this comment.
For nonempty string[]? I think it must be always string.
dg
reviewed
May 7, 2020
| if (in_array($code, [1216, 1217, 1451, 1452, 1701], true)) { | ||
| return new Dibi\ForeignKeyConstraintViolationException($message, $code, $sql); | ||
| if (is_int($code) === true) { | ||
| if (in_array($code, [1216, 1217, 1451, 1452, 1701], true)) { |
Owner
There was a problem hiding this comment.
there is no reason for this change, in_array checks type
Contributor
Author
Owner
There was a problem hiding this comment.
I think in mysql driver it is always int.
dg
reviewed
May 7, 2020
| { | ||
| if ($this->autoFree && $this->getResultResource()) { | ||
| if ($this->autoFree) { | ||
| $this->getResultResource(); |
Contributor
Author
dg
reviewed
May 7, 2020
dg
reviewed
May 7, 2020
dg
reviewed
May 7, 2020
dg
reviewed
May 7, 2020
dg
reviewed
May 7, 2020
dg
reviewed
May 7, 2020
dg
reviewed
May 7, 2020
dg
reviewed
May 7, 2020
138139d to
81a66da
Compare
8db0534 to
cc3b09e
Compare
45c0839 to
8881eb1
Compare
0bdf956 to
96da320
Compare
cefe754 to
ca42569
Compare
3a61c9e to
b47c9cc
Compare
d77bdd6 to
1585255
Compare
16765c4 to
cab1c5b
Compare
0ee3834 to
fafa6cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


I fixed some PhpStan errors.
Resend #363.