8
8
* @see map()
9
9
* @see type()
10
10
* @see elementType()
11
+ * @see sql_injection_subst()
11
12
* @return mixed override pair object
12
13
*/
13
14
function override ($ callable , $ override ) {
@@ -18,7 +19,12 @@ function override($callable, $override) {
18
19
* map argument with #$argNum Literal value to one of expressions
19
20
* @param mixed $argNum ignored, for now its always 0
20
21
* @param mixed $map Key-value pairs: string_literal|const|class_const => class_name::class|pattern_literal
21
- * where pattern literal can contain @ char to be replaced with argument literal value
22
+ * where pattern literal can contain @ char to be replaced with argument literal value.
23
+ *
24
+ * When used with sql_injection_subst(), string literal key-value pairs act as replacement rules: pattern => replacement.
25
+ * These rules are applied in SQL injections in an IDE and enable support for dynamically-prefixed database table names.
26
+ *
27
+ * @see sql_injection_subst()
22
28
* @return mixed overrides map object
23
29
*/
24
30
function map ($ map ) {
@@ -43,6 +49,17 @@ function elementType($argNum) {
43
49
return "elementType $ argNum " ;
44
50
}
45
51
52
+ /**
53
+ * Provides an IDE with a set of replacement rules that are applied in SQL injections.
54
+ * Replacement rules are specified as string literal key-value pairs in the map() call.
55
+ * @param mixed $argNum ignored, for now its always 0
56
+ * @see map()
57
+ * @return mixed
58
+ */
59
+ function sql_injection_subst ($ argNum ) {
60
+ return "sql_injection_subst $ argNum " ;
61
+ }
62
+
46
63
override (\array_shift (0 ), elementType (0 ));
47
64
override (\array_filter (0 ), type (0 ));
48
65
override (\array_reverse (0 ), type (0 ));
0 commit comments