staabm / phpstan-dba

PHPStan based SQL static analysis and type inference for the database access layer
https://staabm.github.io/archive.html#phpstan-dba
MIT License
249 stars 17 forks source link

Fix placeholders detection with multiline strings #658

Closed b-viguier closed 1 month ago

b-viguier commented 1 month ago

Fix #657

In #651, I included the . to mach any character. Actually, it matches any character except newline 😅

Here are several workarounds from stackoverflow

I choose to replace . by (?s:.), because it locally changes the regex flag to also match newline character, without adding too much noise....

Added a test 🎁

staabm commented 1 month ago

Thanks!

@mitelg could you confirm this works for you

mitelg commented 1 month ago

can confirm :heavy_check_mark:

thanks for the fix @b-viguier :+1:

staabm commented 1 month ago

fix released in https://github.com/staabm/phpstan-dba/releases/tag/0.2.81

thank you guys!