You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried looking at this, but I can't really wrap my head around php-parser's AST.
It seems that it would be pretty similar to findQueryStringExpression, where it finds the parent node, and then traverses the children for all the bind* calls.
It seems that it would be pretty similar to findQueryStringExpression, where it finds the parent node, and then traverses the children for all the bind* calls.
exactly. we can only support use-cases where the bindValue (et. all) and the execute are done within the same method.
Activity
[-]PDO: support bindValue based api[/-][+]PDO: support `bindValue` based api[/+]xPaw commentedon Feb 6, 2022
There are also
bindColumnandbindParam.xPaw commentedon Feb 7, 2022
I tried looking at this, but I can't really wrap my head around php-parser's AST.
It seems that it would be pretty similar to
findQueryStringExpression, where it finds the parent node, and then traverses the children for all thebind*calls.staabm commentedon Feb 7, 2022
exactly. we can only support use-cases where the
bindValue(et. all) and theexecuteare done within the same method.similar to https://github.com/staabm/phpstan-dba/blob/main/src/Extensions/PdoStatementExecuteTypeSpecifyingExtension.php in which we find the corresponding sql query arg of
->prepare()which needs to be executed starting from the line whereexecute()is calledstaabm commentedon Feb 7, 2022
for those cases I put the unit test code into https://phpast.com/ and inspect the AST which gets generated.
it helps to find the proper traversing.
xPaw commentedon Feb 10, 2022
While there's basic support for this now, there's still things to do. In particular with bind calls being inside of
ifstatements.As well as bind calls should be an error when there are also parameters being passed into
execute.Not sure if it's worth exploring support for passing in PDO::PARAM_* as third argument in bind calls.
staabm commentedon Feb 10, 2022
I agree in all mentioned points.
We should tackle them one at a time