• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sirbrillig / phpcs-variable-analysis / 13853172128

14 Mar 2025 08:59AM UTC coverage: 93.812%. Remained the same
13853172128

Pull #350

github

jrfnl
GH Actions: use the xmllint-validate action runner

Instead of doing all the installation steps for xmllint validation in the workflow, use the :sparkles: new dedicated `phpcsstandards/xmllint-validate` action runner instead.

Ref: https://github.com/marketplace/actions/xmllint-validate
Pull Request #350: GH Actions: use the xmllint-validate action runner

1880 of 2004 relevant lines covered (93.81%)

137.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/VariableAnalysis/Lib/Constants.php
1
<?php
2

3
namespace VariableAnalysis\Lib;
4

5
class Constants
6
{
7
        /**
8
         *  Array of known pass-by-reference functions and the argument(s) which are passed
9
         *  by reference, the arguments are numbered starting from 1 and an elipsis '...'
10
         *  means all argument numbers after the previous should be considered pass-by-reference.
11
         *
12
         *  This does not need to cover all pass-by-reference arguments, only the
13
         *  ones which can be passed an undefined variable (eg: `$matches` in
14
         *  `preg_match`) and will define that variable.
15
         *
16
         *  @return array<string, array<int|string>>
17
         */
18
        public static function getPassByReferenceFunctions()
158✔
19
        {
20
                return [
79✔
21
                        '__soapCall' => [5],
158✔
22
                        'addFunction' => [3],
158✔
23
                        'addTask' => [3],
158✔
24
                        'addTaskBackground' => [3],
158✔
25
                        'addTaskHigh' => [3],
158✔
26
                        'addTaskHighBackground' => [3],
158✔
27
                        'addTaskLow' => [3],
158✔
28
                        'addTaskLowBackground' => [3],
158✔
29
                        'addTaskStatus' => [2],
158✔
30
                        'apc_dec' => [3],
158✔
31
                        'apc_fetch' => [2],
158✔
32
                        'apc_inc' => [3],
158✔
33
                        'apcu_dec' => [3],
158✔
34
                        'apcu_fetch' => [2],
158✔
35
                        'apcu_inc' => [3],
158✔
36
                        'areConfusable' => [3],
158✔
37
                        'arsort' => [1],
158✔
38
                        'asort' => [1],
158✔
39
                        'bindColumn' => [2],
158✔
40
                        'bindParam' => [2],
158✔
41
                        'bind_param' => [2, 3, '...'],
158✔
42
                        'bind_result' => [1, 2, '...'],
158✔
43
                        'call_user_method' => [2],
158✔
44
                        'call_user_method_array' => [2],
158✔
45
                        'curl_multi_exec' => [2],
158✔
46
                        'curl_multi_info_read' => [2],
158✔
47
                        'current' => [1],
158✔
48
                        'dbplus_curr' => [2],
158✔
49
                        'dbplus_first' => [2],
158✔
50
                        'dbplus_info' => [3],
158✔
51
                        'dbplus_last' => [2],
158✔
52
                        'dbplus_next' => [2],
158✔
53
                        'dbplus_prev' => [2],
158✔
54
                        'dbplus_tremove' => [3],
158✔
55
                        'dns_get_record' => [3, 4],
158✔
56
                        'domxml_open_file' => [3],
158✔
57
                        'domxml_open_mem' => [3],
158✔
58
                        'each' => [1],
158✔
59
                        'enchant_dict_quick_check' => [3],
158✔
60
                        'end' => [1],
158✔
61
                        'ereg' => [3],
158✔
62
                        'eregi' => [3],
158✔
63
                        'exec' => [2, 3],
158✔
64
                        'exif_thumbnail' => [1, 2, 3],
158✔
65
                        'expect_expectl' => [3],
158✔
66
                        'extract' => [1],
158✔
67
                        'filter' => [3],
158✔
68
                        'flock' => [2,3],
158✔
69
                        'fscanf' => [2, 3, '...'],
158✔
70
                        'fsockopen' => [3, 4],
158✔
71
                        'ftp_alloc' => [3],
158✔
72
                        'get' => [2, 3],
158✔
73
                        'getByKey' => [4],
158✔
74
                        'getMulti' => [2],
158✔
75
                        'getMultiByKey' => [3],
158✔
76
                        'getimagesize' => [2],
158✔
77
                        'getmxrr' => [2, 3],
158✔
78
                        'gnupg_decryptverify' => [3],
158✔
79
                        'gnupg_verify' => [4],
158✔
80
                        'grapheme_extract' => [5],
158✔
81
                        'headers_sent' => [1, 2],
158✔
82
                        'http_build_url' => [4],
158✔
83
                        'http_get' => [3],
158✔
84
                        'http_head' => [3],
158✔
85
                        'http_negotiate_charset' => [2],
158✔
86
                        'http_negotiate_content_type' => [2],
158✔
87
                        'http_negotiate_language' => [2],
158✔
88
                        'http_post_data' => [4],
158✔
89
                        'http_post_fields' => [5],
158✔
90
                        'http_put_data' => [4],
158✔
91
                        'http_put_file' => [4],
158✔
92
                        'http_put_stream' => [4],
158✔
93
                        'http_request' => [5],
158✔
94
                        'isSuspicious' => [2],
158✔
95
                        'is_callable' => [3],
158✔
96
                        'key' => [1],
158✔
97
                        'krsort' => [1],
158✔
98
                        'ksort' => [1],
158✔
99
                        'ldap_get_option' => [3],
158✔
100
                        'ldap_parse_reference' => [3],
158✔
101
                        'ldap_parse_result' => [3, 4, 5, 6],
158✔
102
                        'localtime' => [2],
158✔
103
                        'm_completeauthorizations' => [2],
158✔
104
                        'maxdb_stmt_bind_param' => [3, 4, '...'],
158✔
105
                        'maxdb_stmt_bind_result' => [2, 3, '...'],
158✔
106
                        'mb_convert_variables' => [3, 4, '...'],
158✔
107
                        'mb_parse_str' => [2],
158✔
108
                        'mqseries_back' => [2, 3],
158✔
109
                        'mqseries_begin' => [3, 4],
158✔
110
                        'mqseries_close' => [4, 5],
158✔
111
                        'mqseries_cmit' => [2, 3],
158✔
112
                        'mqseries_conn' => [2, 3, 4],
158✔
113
                        'mqseries_connx' => [2, 3, 4, 5],
158✔
114
                        'mqseries_disc' => [2, 3],
158✔
115
                        'mqseries_get' => [3, 4, 5, 6, 7, 8, 9],
158✔
116
                        'mqseries_inq' => [6, 8, 9, 10],
158✔
117
                        'mqseries_open' => [2, 4, 5, 6],
158✔
118
                        'mqseries_put' => [3, 4, 6, 7],
158✔
119
                        'mqseries_put1' => [2, 3, 4, 6, 7],
158✔
120
                        'mqseries_set' => [9, 10],
158✔
121
                        'msg_receive' => [3, 5, 8],
158✔
122
                        'msg_send' => [6],
158✔
123
                        'mssql_bind' => [3],
158✔
124
                        'natcasesort' => [1],
158✔
125
                        'natsort' => [1],
158✔
126
                        'ncurses_color_content' => [2, 3, 4],
158✔
127
                        'ncurses_getmaxyx' => [2, 3],
158✔
128
                        'ncurses_getmouse' => [1],
158✔
129
                        'ncurses_getyx' => [2, 3],
158✔
130
                        'ncurses_instr' => [1],
158✔
131
                        'ncurses_mouse_trafo' => [1, 2],
158✔
132
                        'ncurses_mousemask' => [2],
158✔
133
                        'ncurses_pair_content' => [2, 3],
158✔
134
                        'ncurses_wmouse_trafo' => [2, 3],
158✔
135
                        'newt_button_bar' => [1],
158✔
136
                        'newt_form_run' => [2],
158✔
137
                        'newt_get_screen_size' => [1, 2],
158✔
138
                        'newt_grid_get_size' => [2, 3],
158✔
139
                        'newt_reflow_text' => [5, 6],
158✔
140
                        'newt_win_entries' => [7],
158✔
141
                        'newt_win_menu' => [8],
158✔
142
                        'next' => [1],
158✔
143
                        'oci_bind_array_by_name' => [3],
158✔
144
                        'oci_bind_by_name' => [3],
158✔
145
                        'oci_define_by_name' => [3],
158✔
146
                        'oci_fetch_all' => [2],
158✔
147
                        'ocifetchinto' => [2],
158✔
148
                        'odbc_fetch_into' => [2],
158✔
149
                        'openssl_csr_export' => [2],
158✔
150
                        'openssl_csr_new' => [2],
158✔
151
                        'openssl_open' => [2],
158✔
152
                        'openssl_pkcs12_export' => [2],
158✔
153
                        'openssl_pkcs12_read' => [2],
158✔
154
                        'openssl_pkey_export' => [2],
158✔
155
                        'openssl_private_decrypt' => [2],
158✔
156
                        'openssl_private_encrypt' => [2],
158✔
157
                        'openssl_public_decrypt' => [2],
158✔
158
                        'openssl_public_encrypt' => [2],
158✔
159
                        'openssl_random_pseudo_bytes' => [2],
158✔
160
                        'openssl_seal' => [2, 3],
158✔
161
                        'openssl_sign' => [2],
158✔
162
                        'openssl_x509_export' => [2],
158✔
163
                        'ovrimos_fetch_into' => [2],
158✔
164
                        'parse' => [2,3],
158✔
165
                        'parseCurrency' => [2, 3],
158✔
166
                        'parse_str' => [2],
158✔
167
                        'parsekit_compile_file' => [2],
158✔
168
                        'parsekit_compile_string' => [2],
158✔
169
                        'passthru' => [2],
158✔
170
                        'pcntl_sigprocmask' => [3],
158✔
171
                        'pcntl_sigtimedwait' => [2],
158✔
172
                        'pcntl_sigwaitinfo' => [2],
158✔
173
                        'pcntl_wait' => [1],
158✔
174
                        'pcntl_waitpid' => [2],
158✔
175
                        'pfsockopen' => [3, 4],
158✔
176
                        'php_check_syntax' => [2],
158✔
177
                        'poll' => [1, 2, 3],
158✔
178
                        'preg_filter' => [5],
158✔
179
                        'preg_match' => [3],
158✔
180
                        'preg_match_all' => [3],
158✔
181
                        'preg_replace' => [5],
158✔
182
                        'preg_replace_callback' => [5],
158✔
183
                        'prev' => [1],
158✔
184
                        'proc_open' => [3],
158✔
185
                        'query' => [3],
158✔
186
                        'queryExec' => [2],
158✔
187
                        'reset' => [1],
158✔
188
                        'rsort' => [1],
158✔
189
                        'settype' => [1],
158✔
190
                        'shuffle' => [1],
158✔
191
                        'similar_text' => [3],
158✔
192
                        'socket_create_pair' => [4],
158✔
193
                        'socket_getpeername' => [2, 3],
158✔
194
                        'socket_getsockname' => [2, 3],
158✔
195
                        'socket_recv' => [2],
158✔
196
                        'socket_recvfrom' => [2, 5, 6],
158✔
197
                        'socket_select' => [1, 2, 3],
158✔
198
                        'sort' => [1],
158✔
199
                        'sortWithSortKeys' => [1],
158✔
200
                        'sqlite_exec' => [3],
158✔
201
                        'sqlite_factory' => [3],
158✔
202
                        'sqlite_open' => [3],
158✔
203
                        'sqlite_popen' => [3],
158✔
204
                        'sqlite_query' => [4],
158✔
205
                        'sqlite_unbuffered_query' => [4],
158✔
206
                        'sscanf' => [3, '...'],
158✔
207
                        'str_ireplace' => [4],
158✔
208
                        'str_replace' => [4],
158✔
209
                        'stream_open' => [4],
158✔
210
                        'stream_select' => [1, 2, 3],
158✔
211
                        'stream_socket_accept' => [3],
158✔
212
                        'stream_socket_client' => [2, 3],
158✔
213
                        'stream_socket_recvfrom' => [4],
158✔
214
                        'stream_socket_server' => [2, 3],
158✔
215
                        'system' => [2],
158✔
216
                        'uasort' => [1],
158✔
217
                        'uksort' => [1],
158✔
218
                        'unbufferedQuery' => [3],
158✔
219
                        'usort' => [1],
158✔
220
                        'wincache_ucache_dec' => [3],
158✔
221
                        'wincache_ucache_get' => [2],
158✔
222
                        'wincache_ucache_inc' => [3],
158✔
223
                        'xdiff_string_merge3' => [4],
158✔
224
                        'xdiff_string_patch' => [4],
158✔
225
                        'xml_parse_into_struct' => [3, 4],
158✔
226
                        'xml_set_object' => [2],
158✔
227
                        'xmlrpc_decode_request' => [2],
158✔
228
                        'xmlrpc_set_type' => [1],
158✔
229
                        'xslt_set_object' => [2],
158✔
230
                        'yaml_parse' => [3],
158✔
231
                        'yaml_parse_file' => [3],
158✔
232
                        'yaml_parse_url' => [3],
158✔
233
                        'yaz_ccl_parse' => [3],
158✔
234
                        'yaz_hits' => [2],
158✔
235
                        'yaz_scan_result' => [2],
158✔
236
                        'yaz_wait' => [1],
158✔
237
                ];
158✔
238
        }
239

240
        /**
241
         * @return array<string, array<int>>
242
         */
243
        public static function getWordPressPassByReferenceFunctions()
4✔
244
        {
245
                return [
2✔
246
                        'wp_parse_str' => [2],
4✔
247
                        'wp_cache_get' => [4],
4✔
248
                ];
4✔
249
        }
250

251
        /**
252
         * A regexp for matching variable names in double-quoted strings.
253
         *
254
         * @return string
255
         */
256
        public static function getDoubleQuotedVarRegexp()
164✔
257
        {
258
                return '|(?<!\\\\)(?:\\\\{2})*\${?([a-zA-Z0-9_]+)}?|';
164✔
259
        }
260
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc