yii2support
yii2support copied to clipboard
Unexpected inspection error for Yii::$app->db->createCommand()
What steps will reproduce the problem?
write code:
$command = \Yii::$app->db->createCommand("SELECT GetClientPlannedreturnmonyCount(:repId) AS result");
$command->bindValues([':repId' => $rep->RepID]);
What is the expected result?
Don't show the inspection error, becuase the parameters provided by bindValues() method in the next line.
What do you get instead?
I got an inspection error:

Condition parameters must be defined less... (Ctrl+F1) Inspection info: Analyzes SQL condition and checks if all declared parameters are set
Additional info
| Q | A |
|---|---|
| IDE Name | PhpStorm |
| IDE Version | 2018.2 |
| Plugin version | 0.9.54.9 |
| Yii App Template | basic / advanced |
Thanks!