Completed
Push — master ( 8e973a...811a95 )
by
unknown
03:40 queued 01:04
created
vendor-bin/php-scoper/vendor/thecodingmachine/safe/generated/rrd.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@
 block discarded – undo
15 15
  */
16 16
 function rrd_create(string $filename, array $options): void
17 17
 {
18
-    error_clear_last();
19
-    $result = \rrd_create($filename, $options);
20
-    if ($result === false) {
21
-        throw RrdException::createFromPhpError();
22
-    }
18
+	error_clear_last();
19
+	$result = \rrd_create($filename, $options);
20
+	if ($result === false) {
21
+		throw RrdException::createFromPhpError();
22
+	}
23 23
 }
Please login to merge, or discard this patch.
vendor-bin/php-scoper/vendor/thecodingmachine/safe/generated/exec.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
  */
89 89
 function proc_get_status($process): array
90 90
 {
91
-    error_clear_last();
92
-    $result = \proc_get_status($process);
93
-    if ($result === false) {
94
-        throw ExecException::createFromPhpError();
95
-    }
96
-    return $result;
91
+	error_clear_last();
92
+	$result = \proc_get_status($process);
93
+	if ($result === false) {
94
+		throw ExecException::createFromPhpError();
95
+	}
96
+	return $result;
97 97
 }
98 98
 
99 99
 
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
  */
120 120
 function proc_nice(int $increment): void
121 121
 {
122
-    error_clear_last();
123
-    $result = \proc_nice($increment);
124
-    if ($result === false) {
125
-        throw ExecException::createFromPhpError();
126
-    }
122
+	error_clear_last();
123
+	$result = \proc_nice($increment);
124
+	if ($result === false) {
125
+		throw ExecException::createFromPhpError();
126
+	}
127 127
 }
128 128
 
129 129
 
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
  */
151 151
 function system(string $command, int &$return_var = null): string
152 152
 {
153
-    error_clear_last();
154
-    $result = \system($command, $return_var);
155
-    if ($result === false) {
156
-        throw ExecException::createFromPhpError();
157
-    }
158
-    return $result;
153
+	error_clear_last();
154
+	$result = \system($command, $return_var);
155
+	if ($result === false) {
156
+		throw ExecException::createFromPhpError();
157
+	}
158
+	return $result;
159 159
 }
Please login to merge, or discard this patch.
vendor-bin/php-scoper/vendor/thecodingmachine/safe/rector-migrate-0.7.php 2 patches
Indentation   +1069 added lines, -1069 removed lines patch added patch discarded remove patch
@@ -7,1075 +7,1075 @@
 block discarded – undo
7 7
 
8 8
 # This file configures rector/rector:~0.7.0 to replace all PHP functions with their equivalent "safe" functions
9 9
 return static function (ContainerConfigurator $containerConfigurator): void {
10
-    $services = $containerConfigurator->services();
10
+	$services = $containerConfigurator->services();
11 11
 
12
-    $services->set(RenameFunctionRector::class)
13
-        ->call('configure', [[ RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [
14
-            'apache_getenv' => 'Safe\apache_getenv',
15
-            'apache_get_version' => 'Safe\apache_get_version',
16
-            'apache_request_headers' => 'Safe\apache_request_headers',
17
-            'apache_reset_timeout' => 'Safe\apache_reset_timeout',
18
-            'apache_response_headers' => 'Safe\apache_response_headers',
19
-            'apache_setenv' => 'Safe\apache_setenv',
20
-            'apcu_cache_info' => 'Safe\apcu_cache_info',
21
-            'apcu_cas' => 'Safe\apcu_cas',
22
-            'apcu_dec' => 'Safe\apcu_dec',
23
-            'apcu_fetch' => 'Safe\apcu_fetch',
24
-            'apcu_inc' => 'Safe\apcu_inc',
25
-            'apcu_sma_info' => 'Safe\apcu_sma_info',
26
-            'apc_fetch' => 'Safe\apc_fetch',
27
-            'array_combine' => 'Safe\array_combine',
28
-            'array_flip' => 'Safe\array_flip',
29
-            'array_replace' => 'Safe\array_replace',
30
-            'array_replace_recursive' => 'Safe\array_replace_recursive',
31
-            'array_walk_recursive' => 'Safe\array_walk_recursive',
32
-            'arsort' => 'Safe\arsort',
33
-            'asort' => 'Safe\asort',
34
-            'base64_decode' => 'Safe\base64_decode',
35
-            'bzclose' => 'Safe\bzclose',
36
-            'bzflush' => 'Safe\bzflush',
37
-            'bzread' => 'Safe\bzread',
38
-            'bzwrite' => 'Safe\bzwrite',
39
-            'chdir' => 'Safe\chdir',
40
-            'chgrp' => 'Safe\chgrp',
41
-            'chmod' => 'Safe\chmod',
42
-            'chown' => 'Safe\chown',
43
-            'chroot' => 'Safe\chroot',
44
-            'class_alias' => 'Safe\class_alias',
45
-            'class_implements' => 'Safe\class_implements',
46
-            'class_parents' => 'Safe\class_parents',
47
-            'class_uses' => 'Safe\class_uses',
48
-            'cli_set_process_title' => 'Safe\cli_set_process_title',
49
-            'closelog' => 'Safe\closelog',
50
-            'com_event_sink' => 'Safe\com_event_sink',
51
-            'com_load_typelib' => 'Safe\com_load_typelib',
52
-            'com_print_typeinfo' => 'Safe\com_print_typeinfo',
53
-            'convert_uudecode' => 'Safe\convert_uudecode',
54
-            'convert_uuencode' => 'Safe\convert_uuencode',
55
-            'copy' => 'Safe\copy',
56
-            'create_function' => 'Safe\create_function',
57
-            'cubrid_free_result' => 'Safe\cubrid_free_result',
58
-            'cubrid_get_charset' => 'Safe\cubrid_get_charset',
59
-            'cubrid_get_client_info' => 'Safe\cubrid_get_client_info',
60
-            'cubrid_get_db_parameter' => 'Safe\cubrid_get_db_parameter',
61
-            'cubrid_get_server_info' => 'Safe\cubrid_get_server_info',
62
-            'cubrid_insert_id' => 'Safe\cubrid_insert_id',
63
-            'cubrid_lob2_new' => 'Safe\cubrid_lob2_new',
64
-            'cubrid_lob2_size' => 'Safe\cubrid_lob2_size',
65
-            'cubrid_lob2_size64' => 'Safe\cubrid_lob2_size64',
66
-            'cubrid_lob2_tell' => 'Safe\cubrid_lob2_tell',
67
-            'cubrid_lob2_tell64' => 'Safe\cubrid_lob2_tell64',
68
-            'cubrid_set_db_parameter' => 'Safe\cubrid_set_db_parameter',
69
-            'curl_escape' => 'Safe\curl_escape',
70
-            'curl_exec' => 'Safe\curl_exec',
71
-            'curl_getinfo' => 'Safe\curl_getinfo',
72
-            'curl_init' => 'Safe\curl_init',
73
-            'curl_multi_errno' => 'Safe\curl_multi_errno',
74
-            'curl_multi_info_read' => 'Safe\curl_multi_info_read',
75
-            'curl_multi_init' => 'Safe\curl_multi_init',
76
-            'curl_setopt' => 'Safe\curl_setopt',
77
-            'curl_share_errno' => 'Safe\curl_share_errno',
78
-            'curl_share_setopt' => 'Safe\curl_share_setopt',
79
-            'curl_unescape' => 'Safe\curl_unescape',
80
-            'date' => 'Safe\date',
81
-            'date_parse' => 'Safe\date_parse',
82
-            'date_parse_from_format' => 'Safe\date_parse_from_format',
83
-            'date_sunrise' => 'Safe\date_sunrise',
84
-            'date_sunset' => 'Safe\date_sunset',
85
-            'date_sun_info' => 'Safe\date_sun_info',
86
-            'db2_autocommit' => 'Safe\db2_autocommit',
87
-            'db2_bind_param' => 'Safe\db2_bind_param',
88
-            'db2_client_info' => 'Safe\db2_client_info',
89
-            'db2_close' => 'Safe\db2_close',
90
-            'db2_commit' => 'Safe\db2_commit',
91
-            'db2_execute' => 'Safe\db2_execute',
92
-            'db2_free_result' => 'Safe\db2_free_result',
93
-            'db2_free_stmt' => 'Safe\db2_free_stmt',
94
-            'db2_get_option' => 'Safe\db2_get_option',
95
-            'db2_pclose' => 'Safe\db2_pclose',
96
-            'db2_rollback' => 'Safe\db2_rollback',
97
-            'db2_server_info' => 'Safe\db2_server_info',
98
-            'db2_set_option' => 'Safe\db2_set_option',
99
-            'define' => 'Safe\define',
100
-            'deflate_add' => 'Safe\deflate_add',
101
-            'deflate_init' => 'Safe\deflate_init',
102
-            'disk_free_space' => 'Safe\disk_free_space',
103
-            'disk_total_space' => 'Safe\disk_total_space',
104
-            'dl' => 'Safe\dl',
105
-            'dns_get_record' => 'Safe\dns_get_record',
106
-            'eio_busy' => 'Safe\eio_busy',
107
-            'eio_chmod' => 'Safe\eio_chmod',
108
-            'eio_chown' => 'Safe\eio_chown',
109
-            'eio_close' => 'Safe\eio_close',
110
-            'eio_custom' => 'Safe\eio_custom',
111
-            'eio_dup2' => 'Safe\eio_dup2',
112
-            'eio_event_loop' => 'Safe\eio_event_loop',
113
-            'eio_fallocate' => 'Safe\eio_fallocate',
114
-            'eio_fchmod' => 'Safe\eio_fchmod',
115
-            'eio_fdatasync' => 'Safe\eio_fdatasync',
116
-            'eio_fstat' => 'Safe\eio_fstat',
117
-            'eio_fstatvfs' => 'Safe\eio_fstatvfs',
118
-            'eio_fsync' => 'Safe\eio_fsync',
119
-            'eio_ftruncate' => 'Safe\eio_ftruncate',
120
-            'eio_futime' => 'Safe\eio_futime',
121
-            'eio_grp' => 'Safe\eio_grp',
122
-            'eio_lstat' => 'Safe\eio_lstat',
123
-            'eio_mkdir' => 'Safe\eio_mkdir',
124
-            'eio_mknod' => 'Safe\eio_mknod',
125
-            'eio_nop' => 'Safe\eio_nop',
126
-            'eio_readahead' => 'Safe\eio_readahead',
127
-            'eio_readdir' => 'Safe\eio_readdir',
128
-            'eio_readlink' => 'Safe\eio_readlink',
129
-            'eio_rename' => 'Safe\eio_rename',
130
-            'eio_rmdir' => 'Safe\eio_rmdir',
131
-            'eio_seek' => 'Safe\eio_seek',
132
-            'eio_sendfile' => 'Safe\eio_sendfile',
133
-            'eio_stat' => 'Safe\eio_stat',
134
-            'eio_statvfs' => 'Safe\eio_statvfs',
135
-            'eio_symlink' => 'Safe\eio_symlink',
136
-            'eio_sync' => 'Safe\eio_sync',
137
-            'eio_syncfs' => 'Safe\eio_syncfs',
138
-            'eio_sync_file_range' => 'Safe\eio_sync_file_range',
139
-            'eio_truncate' => 'Safe\eio_truncate',
140
-            'eio_unlink' => 'Safe\eio_unlink',
141
-            'eio_utime' => 'Safe\eio_utime',
142
-            'eio_write' => 'Safe\eio_write',
143
-            'error_log' => 'Safe\error_log',
144
-            'fastcgi_finish_request' => 'Safe\fastcgi_finish_request',
145
-            'fbird_blob_cancel' => 'Safe\fbird_blob_cancel',
146
-            'fclose' => 'Safe\fclose',
147
-            'fflush' => 'Safe\fflush',
148
-            'file' => 'Safe\file',
149
-            'fileatime' => 'Safe\fileatime',
150
-            'filectime' => 'Safe\filectime',
151
-            'fileinode' => 'Safe\fileinode',
152
-            'filemtime' => 'Safe\filemtime',
153
-            'fileowner' => 'Safe\fileowner',
154
-            'filesize' => 'Safe\filesize',
155
-            'file_get_contents' => 'Safe\file_get_contents',
156
-            'file_put_contents' => 'Safe\file_put_contents',
157
-            'filter_input_array' => 'Safe\filter_input_array',
158
-            'filter_var_array' => 'Safe\filter_var_array',
159
-            'finfo_close' => 'Safe\finfo_close',
160
-            'finfo_open' => 'Safe\finfo_open',
161
-            'flock' => 'Safe\flock',
162
-            'fopen' => 'Safe\fopen',
163
-            'fputcsv' => 'Safe\fputcsv',
164
-            'fread' => 'Safe\fread',
165
-            'fsockopen' => 'Safe\fsockopen',
166
-            'ftp_alloc' => 'Safe\ftp_alloc',
167
-            'ftp_append' => 'Safe\ftp_append',
168
-            'ftp_cdup' => 'Safe\ftp_cdup',
169
-            'ftp_chdir' => 'Safe\ftp_chdir',
170
-            'ftp_chmod' => 'Safe\ftp_chmod',
171
-            'ftp_close' => 'Safe\ftp_close',
172
-            'ftp_connect' => 'Safe\ftp_connect',
173
-            'ftp_delete' => 'Safe\ftp_delete',
174
-            'ftp_fget' => 'Safe\ftp_fget',
175
-            'ftp_fput' => 'Safe\ftp_fput',
176
-            'ftp_get' => 'Safe\ftp_get',
177
-            'ftp_login' => 'Safe\ftp_login',
178
-            'ftp_mkdir' => 'Safe\ftp_mkdir',
179
-            'ftp_mlsd' => 'Safe\ftp_mlsd',
180
-            'ftp_nlist' => 'Safe\ftp_nlist',
181
-            'ftp_pasv' => 'Safe\ftp_pasv',
182
-            'ftp_put' => 'Safe\ftp_put',
183
-            'ftp_pwd' => 'Safe\ftp_pwd',
184
-            'ftp_rename' => 'Safe\ftp_rename',
185
-            'ftp_rmdir' => 'Safe\ftp_rmdir',
186
-            'ftp_site' => 'Safe\ftp_site',
187
-            'ftp_ssl_connect' => 'Safe\ftp_ssl_connect',
188
-            'ftp_systype' => 'Safe\ftp_systype',
189
-            'ftruncate' => 'Safe\ftruncate',
190
-            'fwrite' => 'Safe\fwrite',
191
-            'getallheaders' => 'Safe\getallheaders',
192
-            'getcwd' => 'Safe\getcwd',
193
-            'gethostname' => 'Safe\gethostname',
194
-            'getimagesize' => 'Safe\getimagesize',
195
-            'getlastmod' => 'Safe\getlastmod',
196
-            'getmygid' => 'Safe\getmygid',
197
-            'getmyinode' => 'Safe\getmyinode',
198
-            'getmypid' => 'Safe\getmypid',
199
-            'getmyuid' => 'Safe\getmyuid',
200
-            'getopt' => 'Safe\getopt',
201
-            'getprotobyname' => 'Safe\getprotobyname',
202
-            'getprotobynumber' => 'Safe\getprotobynumber',
203
-            'get_headers' => 'Safe\get_headers',
204
-            'glob' => 'Safe\glob',
205
-            'gmdate' => 'Safe\gmdate',
206
-            'gmp_binomial' => 'Safe\gmp_binomial',
207
-            'gmp_export' => 'Safe\gmp_export',
208
-            'gmp_import' => 'Safe\gmp_import',
209
-            'gmp_random_seed' => 'Safe\gmp_random_seed',
210
-            'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey',
211
-            'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey',
212
-            'gnupg_addsignkey' => 'Safe\gnupg_addsignkey',
213
-            'gnupg_cleardecryptkeys' => 'Safe\gnupg_cleardecryptkeys',
214
-            'gnupg_clearencryptkeys' => 'Safe\gnupg_clearencryptkeys',
215
-            'gnupg_clearsignkeys' => 'Safe\gnupg_clearsignkeys',
216
-            'gnupg_setarmor' => 'Safe\gnupg_setarmor',
217
-            'gnupg_setsignmode' => 'Safe\gnupg_setsignmode',
218
-            'gzclose' => 'Safe\gzclose',
219
-            'gzcompress' => 'Safe\gzcompress',
220
-            'gzdecode' => 'Safe\gzdecode',
221
-            'gzdeflate' => 'Safe\gzdeflate',
222
-            'gzencode' => 'Safe\gzencode',
223
-            'gzgets' => 'Safe\gzgets',
224
-            'gzgetss' => 'Safe\gzgetss',
225
-            'gzinflate' => 'Safe\gzinflate',
226
-            'gzpassthru' => 'Safe\gzpassthru',
227
-            'gzrewind' => 'Safe\gzrewind',
228
-            'gzuncompress' => 'Safe\gzuncompress',
229
-            'hash_hkdf' => 'Safe\hash_hkdf',
230
-            'hash_update_file' => 'Safe\hash_update_file',
231
-            'header_register_callback' => 'Safe\header_register_callback',
232
-            'hex2bin' => 'Safe\hex2bin',
233
-            'highlight_file' => 'Safe\highlight_file',
234
-            'highlight_string' => 'Safe\highlight_string',
235
-            'ibase_add_user' => 'Safe\ibase_add_user',
236
-            'ibase_backup' => 'Safe\ibase_backup',
237
-            'ibase_blob_cancel' => 'Safe\ibase_blob_cancel',
238
-            'ibase_blob_create' => 'Safe\ibase_blob_create',
239
-            'ibase_blob_get' => 'Safe\ibase_blob_get',
240
-            'ibase_close' => 'Safe\ibase_close',
241
-            'ibase_commit' => 'Safe\ibase_commit',
242
-            'ibase_commit_ret' => 'Safe\ibase_commit_ret',
243
-            'ibase_connect' => 'Safe\ibase_connect',
244
-            'ibase_delete_user' => 'Safe\ibase_delete_user',
245
-            'ibase_drop_db' => 'Safe\ibase_drop_db',
246
-            'ibase_free_event_handler' => 'Safe\ibase_free_event_handler',
247
-            'ibase_free_query' => 'Safe\ibase_free_query',
248
-            'ibase_free_result' => 'Safe\ibase_free_result',
249
-            'ibase_maintain_db' => 'Safe\ibase_maintain_db',
250
-            'ibase_modify_user' => 'Safe\ibase_modify_user',
251
-            'ibase_name_result' => 'Safe\ibase_name_result',
252
-            'ibase_pconnect' => 'Safe\ibase_pconnect',
253
-            'ibase_restore' => 'Safe\ibase_restore',
254
-            'ibase_rollback' => 'Safe\ibase_rollback',
255
-            'ibase_rollback_ret' => 'Safe\ibase_rollback_ret',
256
-            'ibase_service_attach' => 'Safe\ibase_service_attach',
257
-            'ibase_service_detach' => 'Safe\ibase_service_detach',
258
-            'iconv' => 'Safe\iconv',
259
-            'iconv_get_encoding' => 'Safe\iconv_get_encoding',
260
-            'iconv_set_encoding' => 'Safe\iconv_set_encoding',
261
-            'image2wbmp' => 'Safe\image2wbmp',
262
-            'imageaffine' => 'Safe\imageaffine',
263
-            'imageaffinematrixconcat' => 'Safe\imageaffinematrixconcat',
264
-            'imageaffinematrixget' => 'Safe\imageaffinematrixget',
265
-            'imagealphablending' => 'Safe\imagealphablending',
266
-            'imageantialias' => 'Safe\imageantialias',
267
-            'imagearc' => 'Safe\imagearc',
268
-            'imagebmp' => 'Safe\imagebmp',
269
-            'imagechar' => 'Safe\imagechar',
270
-            'imagecharup' => 'Safe\imagecharup',
271
-            'imagecolorat' => 'Safe\imagecolorat',
272
-            'imagecolordeallocate' => 'Safe\imagecolordeallocate',
273
-            'imagecolormatch' => 'Safe\imagecolormatch',
274
-            'imageconvolution' => 'Safe\imageconvolution',
275
-            'imagecopy' => 'Safe\imagecopy',
276
-            'imagecopymerge' => 'Safe\imagecopymerge',
277
-            'imagecopymergegray' => 'Safe\imagecopymergegray',
278
-            'imagecopyresampled' => 'Safe\imagecopyresampled',
279
-            'imagecopyresized' => 'Safe\imagecopyresized',
280
-            'imagecreate' => 'Safe\imagecreate',
281
-            'imagecreatefrombmp' => 'Safe\imagecreatefrombmp',
282
-            'imagecreatefromgd' => 'Safe\imagecreatefromgd',
283
-            'imagecreatefromgd2' => 'Safe\imagecreatefromgd2',
284
-            'imagecreatefromgd2part' => 'Safe\imagecreatefromgd2part',
285
-            'imagecreatefromgif' => 'Safe\imagecreatefromgif',
286
-            'imagecreatefromjpeg' => 'Safe\imagecreatefromjpeg',
287
-            'imagecreatefrompng' => 'Safe\imagecreatefrompng',
288
-            'imagecreatefromwbmp' => 'Safe\imagecreatefromwbmp',
289
-            'imagecreatefromwebp' => 'Safe\imagecreatefromwebp',
290
-            'imagecreatefromxbm' => 'Safe\imagecreatefromxbm',
291
-            'imagecreatefromxpm' => 'Safe\imagecreatefromxpm',
292
-            'imagecreatetruecolor' => 'Safe\imagecreatetruecolor',
293
-            'imagecrop' => 'Safe\imagecrop',
294
-            'imagecropauto' => 'Safe\imagecropauto',
295
-            'imagedashedline' => 'Safe\imagedashedline',
296
-            'imagedestroy' => 'Safe\imagedestroy',
297
-            'imageellipse' => 'Safe\imageellipse',
298
-            'imagefill' => 'Safe\imagefill',
299
-            'imagefilledarc' => 'Safe\imagefilledarc',
300
-            'imagefilledellipse' => 'Safe\imagefilledellipse',
301
-            'imagefilledpolygon' => 'Safe\imagefilledpolygon',
302
-            'imagefilledrectangle' => 'Safe\imagefilledrectangle',
303
-            'imagefilltoborder' => 'Safe\imagefilltoborder',
304
-            'imagefilter' => 'Safe\imagefilter',
305
-            'imageflip' => 'Safe\imageflip',
306
-            'imagegammacorrect' => 'Safe\imagegammacorrect',
307
-            'imagegd' => 'Safe\imagegd',
308
-            'imagegd2' => 'Safe\imagegd2',
309
-            'imagegif' => 'Safe\imagegif',
310
-            'imagegrabscreen' => 'Safe\imagegrabscreen',
311
-            'imagegrabwindow' => 'Safe\imagegrabwindow',
312
-            'imagejpeg' => 'Safe\imagejpeg',
313
-            'imagelayereffect' => 'Safe\imagelayereffect',
314
-            'imageline' => 'Safe\imageline',
315
-            'imageloadfont' => 'Safe\imageloadfont',
316
-            'imageopenpolygon' => 'Safe\imageopenpolygon',
317
-            'imagepng' => 'Safe\imagepng',
318
-            'imagepolygon' => 'Safe\imagepolygon',
319
-            'imagerectangle' => 'Safe\imagerectangle',
320
-            'imagerotate' => 'Safe\imagerotate',
321
-            'imagesavealpha' => 'Safe\imagesavealpha',
322
-            'imagescale' => 'Safe\imagescale',
323
-            'imagesetbrush' => 'Safe\imagesetbrush',
324
-            'imagesetclip' => 'Safe\imagesetclip',
325
-            'imagesetinterpolation' => 'Safe\imagesetinterpolation',
326
-            'imagesetpixel' => 'Safe\imagesetpixel',
327
-            'imagesetstyle' => 'Safe\imagesetstyle',
328
-            'imagesetthickness' => 'Safe\imagesetthickness',
329
-            'imagesettile' => 'Safe\imagesettile',
330
-            'imagestring' => 'Safe\imagestring',
331
-            'imagestringup' => 'Safe\imagestringup',
332
-            'imagesx' => 'Safe\imagesx',
333
-            'imagesy' => 'Safe\imagesy',
334
-            'imagetruecolortopalette' => 'Safe\imagetruecolortopalette',
335
-            'imagettfbbox' => 'Safe\imagettfbbox',
336
-            'imagettftext' => 'Safe\imagettftext',
337
-            'imagewbmp' => 'Safe\imagewbmp',
338
-            'imagewebp' => 'Safe\imagewebp',
339
-            'imagexbm' => 'Safe\imagexbm',
340
-            'imap_append' => 'Safe\imap_append',
341
-            'imap_check' => 'Safe\imap_check',
342
-            'imap_clearflag_full' => 'Safe\imap_clearflag_full',
343
-            'imap_close' => 'Safe\imap_close',
344
-            'imap_createmailbox' => 'Safe\imap_createmailbox',
345
-            'imap_deletemailbox' => 'Safe\imap_deletemailbox',
346
-            'imap_fetchstructure' => 'Safe\imap_fetchstructure',
347
-            'imap_gc' => 'Safe\imap_gc',
348
-            'imap_headerinfo' => 'Safe\imap_headerinfo',
349
-            'imap_mail' => 'Safe\imap_mail',
350
-            'imap_mailboxmsginfo' => 'Safe\imap_mailboxmsginfo',
351
-            'imap_mail_compose' => 'Safe\imap_mail_compose',
352
-            'imap_mail_copy' => 'Safe\imap_mail_copy',
353
-            'imap_mail_move' => 'Safe\imap_mail_move',
354
-            'imap_mutf7_to_utf8' => 'Safe\imap_mutf7_to_utf8',
355
-            'imap_num_msg' => 'Safe\imap_num_msg',
356
-            'imap_open' => 'Safe\imap_open',
357
-            'imap_renamemailbox' => 'Safe\imap_renamemailbox',
358
-            'imap_savebody' => 'Safe\imap_savebody',
359
-            'imap_setacl' => 'Safe\imap_setacl',
360
-            'imap_setflag_full' => 'Safe\imap_setflag_full',
361
-            'imap_set_quota' => 'Safe\imap_set_quota',
362
-            'imap_sort' => 'Safe\imap_sort',
363
-            'imap_subscribe' => 'Safe\imap_subscribe',
364
-            'imap_thread' => 'Safe\imap_thread',
365
-            'imap_timeout' => 'Safe\imap_timeout',
366
-            'imap_undelete' => 'Safe\imap_undelete',
367
-            'imap_unsubscribe' => 'Safe\imap_unsubscribe',
368
-            'imap_utf8_to_mutf7' => 'Safe\imap_utf8_to_mutf7',
369
-            'inet_ntop' => 'Safe\inet_ntop',
370
-            'inflate_add' => 'Safe\inflate_add',
371
-            'inflate_get_read_len' => 'Safe\inflate_get_read_len',
372
-            'inflate_get_status' => 'Safe\inflate_get_status',
373
-            'inflate_init' => 'Safe\inflate_init',
374
-            'ingres_autocommit' => 'Safe\ingres_autocommit',
375
-            'ingres_close' => 'Safe\ingres_close',
376
-            'ingres_commit' => 'Safe\ingres_commit',
377
-            'ingres_connect' => 'Safe\ingres_connect',
378
-            'ingres_execute' => 'Safe\ingres_execute',
379
-            'ingres_field_name' => 'Safe\ingres_field_name',
380
-            'ingres_field_type' => 'Safe\ingres_field_type',
381
-            'ingres_free_result' => 'Safe\ingres_free_result',
382
-            'ingres_pconnect' => 'Safe\ingres_pconnect',
383
-            'ingres_result_seek' => 'Safe\ingres_result_seek',
384
-            'ingres_rollback' => 'Safe\ingres_rollback',
385
-            'ingres_set_environment' => 'Safe\ingres_set_environment',
386
-            'ini_get' => 'Safe\ini_get',
387
-            'ini_set' => 'Safe\ini_set',
388
-            'inotify_init' => 'Safe\inotify_init',
389
-            'inotify_rm_watch' => 'Safe\inotify_rm_watch',
390
-            'iptcembed' => 'Safe\iptcembed',
391
-            'iptcparse' => 'Safe\iptcparse',
392
-            'jdtounix' => 'Safe\jdtounix',
393
-            'jpeg2wbmp' => 'Safe\jpeg2wbmp',
394
-            'json_decode' => 'Safe\json_decode',
395
-            'json_encode' => 'Safe\json_encode',
396
-            'json_last_error_msg' => 'Safe\json_last_error_msg',
397
-            'krsort' => 'Safe\krsort',
398
-            'ksort' => 'Safe\ksort',
399
-            'lchgrp' => 'Safe\lchgrp',
400
-            'lchown' => 'Safe\lchown',
401
-            'ldap_add' => 'Safe\ldap_add',
402
-            'ldap_add_ext' => 'Safe\ldap_add_ext',
403
-            'ldap_bind' => 'Safe\ldap_bind',
404
-            'ldap_bind_ext' => 'Safe\ldap_bind_ext',
405
-            'ldap_control_paged_result' => 'Safe\ldap_control_paged_result',
406
-            'ldap_control_paged_result_response' => 'Safe\ldap_control_paged_result_response',
407
-            'ldap_count_entries' => 'Safe\ldap_count_entries',
408
-            'ldap_delete' => 'Safe\ldap_delete',
409
-            'ldap_delete_ext' => 'Safe\ldap_delete_ext',
410
-            'ldap_exop' => 'Safe\ldap_exop',
411
-            'ldap_exop_passwd' => 'Safe\ldap_exop_passwd',
412
-            'ldap_exop_whoami' => 'Safe\ldap_exop_whoami',
413
-            'ldap_explode_dn' => 'Safe\ldap_explode_dn',
414
-            'ldap_first_attribute' => 'Safe\ldap_first_attribute',
415
-            'ldap_first_entry' => 'Safe\ldap_first_entry',
416
-            'ldap_free_result' => 'Safe\ldap_free_result',
417
-            'ldap_get_attributes' => 'Safe\ldap_get_attributes',
418
-            'ldap_get_dn' => 'Safe\ldap_get_dn',
419
-            'ldap_get_entries' => 'Safe\ldap_get_entries',
420
-            'ldap_get_option' => 'Safe\ldap_get_option',
421
-            'ldap_get_values' => 'Safe\ldap_get_values',
422
-            'ldap_get_values_len' => 'Safe\ldap_get_values_len',
423
-            'ldap_list' => 'Safe\ldap_list',
424
-            'ldap_modify_batch' => 'Safe\ldap_modify_batch',
425
-            'ldap_mod_add' => 'Safe\ldap_mod_add',
426
-            'ldap_mod_add_ext' => 'Safe\ldap_mod_add_ext',
427
-            'ldap_mod_del' => 'Safe\ldap_mod_del',
428
-            'ldap_mod_del_ext' => 'Safe\ldap_mod_del_ext',
429
-            'ldap_mod_replace' => 'Safe\ldap_mod_replace',
430
-            'ldap_mod_replace_ext' => 'Safe\ldap_mod_replace_ext',
431
-            'ldap_next_attribute' => 'Safe\ldap_next_attribute',
432
-            'ldap_parse_exop' => 'Safe\ldap_parse_exop',
433
-            'ldap_parse_result' => 'Safe\ldap_parse_result',
434
-            'ldap_read' => 'Safe\ldap_read',
435
-            'ldap_rename' => 'Safe\ldap_rename',
436
-            'ldap_rename_ext' => 'Safe\ldap_rename_ext',
437
-            'ldap_sasl_bind' => 'Safe\ldap_sasl_bind',
438
-            'ldap_search' => 'Safe\ldap_search',
439
-            'ldap_set_option' => 'Safe\ldap_set_option',
440
-            'ldap_unbind' => 'Safe\ldap_unbind',
441
-            'libxml_get_last_error' => 'Safe\libxml_get_last_error',
442
-            'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader',
443
-            'link' => 'Safe\link',
444
-            'lzf_compress' => 'Safe\lzf_compress',
445
-            'lzf_decompress' => 'Safe\lzf_decompress',
446
-            'mailparse_msg_extract_part_file' => 'Safe\mailparse_msg_extract_part_file',
447
-            'mailparse_msg_free' => 'Safe\mailparse_msg_free',
448
-            'mailparse_msg_parse' => 'Safe\mailparse_msg_parse',
449
-            'mailparse_msg_parse_file' => 'Safe\mailparse_msg_parse_file',
450
-            'mailparse_stream_encode' => 'Safe\mailparse_stream_encode',
451
-            'mb_chr' => 'Safe\mb_chr',
452
-            'mb_detect_order' => 'Safe\mb_detect_order',
453
-            'mb_encoding_aliases' => 'Safe\mb_encoding_aliases',
454
-            'mb_eregi_replace' => 'Safe\mb_eregi_replace',
455
-            'mb_ereg_replace' => 'Safe\mb_ereg_replace',
456
-            'mb_ereg_replace_callback' => 'Safe\mb_ereg_replace_callback',
457
-            'mb_ereg_search_getregs' => 'Safe\mb_ereg_search_getregs',
458
-            'mb_ereg_search_init' => 'Safe\mb_ereg_search_init',
459
-            'mb_ereg_search_regs' => 'Safe\mb_ereg_search_regs',
460
-            'mb_ereg_search_setpos' => 'Safe\mb_ereg_search_setpos',
461
-            'mb_http_output' => 'Safe\mb_http_output',
462
-            'mb_internal_encoding' => 'Safe\mb_internal_encoding',
463
-            'mb_ord' => 'Safe\mb_ord',
464
-            'mb_parse_str' => 'Safe\mb_parse_str',
465
-            'mb_regex_encoding' => 'Safe\mb_regex_encoding',
466
-            'mb_send_mail' => 'Safe\mb_send_mail',
467
-            'mb_split' => 'Safe\mb_split',
468
-            'mb_str_split' => 'Safe\mb_str_split',
469
-            'md5_file' => 'Safe\md5_file',
470
-            'metaphone' => 'Safe\metaphone',
471
-            'mime_content_type' => 'Safe\mime_content_type',
472
-            'mkdir' => 'Safe\mkdir',
473
-            'mktime' => 'Safe\mktime',
474
-            'msg_queue_exists' => 'Safe\msg_queue_exists',
475
-            'msg_receive' => 'Safe\msg_receive',
476
-            'msg_remove_queue' => 'Safe\msg_remove_queue',
477
-            'msg_send' => 'Safe\msg_send',
478
-            'msg_set_queue' => 'Safe\msg_set_queue',
479
-            'msql_affected_rows' => 'Safe\msql_affected_rows',
480
-            'msql_close' => 'Safe\msql_close',
481
-            'msql_connect' => 'Safe\msql_connect',
482
-            'msql_create_db' => 'Safe\msql_create_db',
483
-            'msql_data_seek' => 'Safe\msql_data_seek',
484
-            'msql_db_query' => 'Safe\msql_db_query',
485
-            'msql_drop_db' => 'Safe\msql_drop_db',
486
-            'msql_field_len' => 'Safe\msql_field_len',
487
-            'msql_field_name' => 'Safe\msql_field_name',
488
-            'msql_field_seek' => 'Safe\msql_field_seek',
489
-            'msql_field_table' => 'Safe\msql_field_table',
490
-            'msql_field_type' => 'Safe\msql_field_type',
491
-            'msql_free_result' => 'Safe\msql_free_result',
492
-            'msql_pconnect' => 'Safe\msql_pconnect',
493
-            'msql_query' => 'Safe\msql_query',
494
-            'msql_select_db' => 'Safe\msql_select_db',
495
-            'mysqli_get_cache_stats' => 'Safe\mysqli_get_cache_stats',
496
-            'mysqli_get_client_stats' => 'Safe\mysqli_get_client_stats',
497
-            'mysqlnd_ms_dump_servers' => 'Safe\mysqlnd_ms_dump_servers',
498
-            'mysqlnd_ms_fabric_select_global' => 'Safe\mysqlnd_ms_fabric_select_global',
499
-            'mysqlnd_ms_fabric_select_shard' => 'Safe\mysqlnd_ms_fabric_select_shard',
500
-            'mysqlnd_ms_get_last_used_connection' => 'Safe\mysqlnd_ms_get_last_used_connection',
501
-            'mysqlnd_qc_clear_cache' => 'Safe\mysqlnd_qc_clear_cache',
502
-            'mysqlnd_qc_set_is_select' => 'Safe\mysqlnd_qc_set_is_select',
503
-            'mysqlnd_qc_set_storage_handler' => 'Safe\mysqlnd_qc_set_storage_handler',
504
-            'mysql_close' => 'Safe\mysql_close',
505
-            'mysql_connect' => 'Safe\mysql_connect',
506
-            'mysql_create_db' => 'Safe\mysql_create_db',
507
-            'mysql_data_seek' => 'Safe\mysql_data_seek',
508
-            'mysql_db_name' => 'Safe\mysql_db_name',
509
-            'mysql_db_query' => 'Safe\mysql_db_query',
510
-            'mysql_drop_db' => 'Safe\mysql_drop_db',
511
-            'mysql_fetch_lengths' => 'Safe\mysql_fetch_lengths',
512
-            'mysql_field_flags' => 'Safe\mysql_field_flags',
513
-            'mysql_field_len' => 'Safe\mysql_field_len',
514
-            'mysql_field_name' => 'Safe\mysql_field_name',
515
-            'mysql_field_seek' => 'Safe\mysql_field_seek',
516
-            'mysql_free_result' => 'Safe\mysql_free_result',
517
-            'mysql_get_host_info' => 'Safe\mysql_get_host_info',
518
-            'mysql_get_proto_info' => 'Safe\mysql_get_proto_info',
519
-            'mysql_get_server_info' => 'Safe\mysql_get_server_info',
520
-            'mysql_info' => 'Safe\mysql_info',
521
-            'mysql_list_dbs' => 'Safe\mysql_list_dbs',
522
-            'mysql_list_fields' => 'Safe\mysql_list_fields',
523
-            'mysql_list_processes' => 'Safe\mysql_list_processes',
524
-            'mysql_list_tables' => 'Safe\mysql_list_tables',
525
-            'mysql_num_fields' => 'Safe\mysql_num_fields',
526
-            'mysql_num_rows' => 'Safe\mysql_num_rows',
527
-            'mysql_query' => 'Safe\mysql_query',
528
-            'mysql_real_escape_string' => 'Safe\mysql_real_escape_string',
529
-            'mysql_result' => 'Safe\mysql_result',
530
-            'mysql_select_db' => 'Safe\mysql_select_db',
531
-            'mysql_set_charset' => 'Safe\mysql_set_charset',
532
-            'mysql_tablename' => 'Safe\mysql_tablename',
533
-            'mysql_thread_id' => 'Safe\mysql_thread_id',
534
-            'mysql_unbuffered_query' => 'Safe\mysql_unbuffered_query',
535
-            'natcasesort' => 'Safe\natcasesort',
536
-            'natsort' => 'Safe\natsort',
537
-            'ob_end_clean' => 'Safe\ob_end_clean',
538
-            'ob_end_flush' => 'Safe\ob_end_flush',
539
-            'oci_bind_array_by_name' => 'Safe\oci_bind_array_by_name',
540
-            'oci_bind_by_name' => 'Safe\oci_bind_by_name',
541
-            'oci_cancel' => 'Safe\oci_cancel',
542
-            'oci_close' => 'Safe\oci_close',
543
-            'oci_commit' => 'Safe\oci_commit',
544
-            'oci_connect' => 'Safe\oci_connect',
545
-            'oci_define_by_name' => 'Safe\oci_define_by_name',
546
-            'oci_execute' => 'Safe\oci_execute',
547
-            'oci_fetch_all' => 'Safe\oci_fetch_all',
548
-            'oci_field_name' => 'Safe\oci_field_name',
549
-            'oci_field_precision' => 'Safe\oci_field_precision',
550
-            'oci_field_scale' => 'Safe\oci_field_scale',
551
-            'oci_field_size' => 'Safe\oci_field_size',
552
-            'oci_field_type' => 'Safe\oci_field_type',
553
-            'oci_field_type_raw' => 'Safe\oci_field_type_raw',
554
-            'oci_free_descriptor' => 'Safe\oci_free_descriptor',
555
-            'oci_free_statement' => 'Safe\oci_free_statement',
556
-            'oci_new_collection' => 'Safe\oci_new_collection',
557
-            'oci_new_connect' => 'Safe\oci_new_connect',
558
-            'oci_new_cursor' => 'Safe\oci_new_cursor',
559
-            'oci_new_descriptor' => 'Safe\oci_new_descriptor',
560
-            'oci_num_fields' => 'Safe\oci_num_fields',
561
-            'oci_num_rows' => 'Safe\oci_num_rows',
562
-            'oci_parse' => 'Safe\oci_parse',
563
-            'oci_pconnect' => 'Safe\oci_pconnect',
564
-            'oci_result' => 'Safe\oci_result',
565
-            'oci_rollback' => 'Safe\oci_rollback',
566
-            'oci_server_version' => 'Safe\oci_server_version',
567
-            'oci_set_action' => 'Safe\oci_set_action',
568
-            'oci_set_call_timeout' => 'Safe\oci_set_call_timeout',
569
-            'oci_set_client_identifier' => 'Safe\oci_set_client_identifier',
570
-            'oci_set_client_info' => 'Safe\oci_set_client_info',
571
-            'oci_set_db_operation' => 'Safe\oci_set_db_operation',
572
-            'oci_set_edition' => 'Safe\oci_set_edition',
573
-            'oci_set_module_name' => 'Safe\oci_set_module_name',
574
-            'oci_set_prefetch' => 'Safe\oci_set_prefetch',
575
-            'oci_statement_type' => 'Safe\oci_statement_type',
576
-            'oci_unregister_taf_callback' => 'Safe\oci_unregister_taf_callback',
577
-            'odbc_autocommit' => 'Safe\odbc_autocommit',
578
-            'odbc_binmode' => 'Safe\odbc_binmode',
579
-            'odbc_columnprivileges' => 'Safe\odbc_columnprivileges',
580
-            'odbc_columns' => 'Safe\odbc_columns',
581
-            'odbc_commit' => 'Safe\odbc_commit',
582
-            'odbc_data_source' => 'Safe\odbc_data_source',
583
-            'odbc_exec' => 'Safe\odbc_exec',
584
-            'odbc_execute' => 'Safe\odbc_execute',
585
-            'odbc_fetch_into' => 'Safe\odbc_fetch_into',
586
-            'odbc_field_len' => 'Safe\odbc_field_len',
587
-            'odbc_field_name' => 'Safe\odbc_field_name',
588
-            'odbc_field_num' => 'Safe\odbc_field_num',
589
-            'odbc_field_scale' => 'Safe\odbc_field_scale',
590
-            'odbc_field_type' => 'Safe\odbc_field_type',
591
-            'odbc_foreignkeys' => 'Safe\odbc_foreignkeys',
592
-            'odbc_gettypeinfo' => 'Safe\odbc_gettypeinfo',
593
-            'odbc_longreadlen' => 'Safe\odbc_longreadlen',
594
-            'odbc_prepare' => 'Safe\odbc_prepare',
595
-            'odbc_primarykeys' => 'Safe\odbc_primarykeys',
596
-            'odbc_result' => 'Safe\odbc_result',
597
-            'odbc_result_all' => 'Safe\odbc_result_all',
598
-            'odbc_rollback' => 'Safe\odbc_rollback',
599
-            'odbc_setoption' => 'Safe\odbc_setoption',
600
-            'odbc_specialcolumns' => 'Safe\odbc_specialcolumns',
601
-            'odbc_statistics' => 'Safe\odbc_statistics',
602
-            'odbc_tableprivileges' => 'Safe\odbc_tableprivileges',
603
-            'odbc_tables' => 'Safe\odbc_tables',
604
-            'opcache_compile_file' => 'Safe\opcache_compile_file',
605
-            'opcache_get_status' => 'Safe\opcache_get_status',
606
-            'opendir' => 'Safe\opendir',
607
-            'openlog' => 'Safe\openlog',
608
-            'openssl_cipher_iv_length' => 'Safe\openssl_cipher_iv_length',
609
-            'openssl_csr_export' => 'Safe\openssl_csr_export',
610
-            'openssl_csr_export_to_file' => 'Safe\openssl_csr_export_to_file',
611
-            'openssl_csr_get_subject' => 'Safe\openssl_csr_get_subject',
612
-            'openssl_csr_new' => 'Safe\openssl_csr_new',
613
-            'openssl_csr_sign' => 'Safe\openssl_csr_sign',
614
-            'openssl_decrypt' => 'Safe\openssl_decrypt',
615
-            'openssl_dh_compute_key' => 'Safe\openssl_dh_compute_key',
616
-            'openssl_digest' => 'Safe\openssl_digest',
617
-            'openssl_encrypt' => 'Safe\openssl_encrypt',
618
-            'openssl_open' => 'Safe\openssl_open',
619
-            'openssl_pbkdf2' => 'Safe\openssl_pbkdf2',
620
-            'openssl_pkcs7_decrypt' => 'Safe\openssl_pkcs7_decrypt',
621
-            'openssl_pkcs7_encrypt' => 'Safe\openssl_pkcs7_encrypt',
622
-            'openssl_pkcs7_read' => 'Safe\openssl_pkcs7_read',
623
-            'openssl_pkcs7_sign' => 'Safe\openssl_pkcs7_sign',
624
-            'openssl_pkcs12_export' => 'Safe\openssl_pkcs12_export',
625
-            'openssl_pkcs12_export_to_file' => 'Safe\openssl_pkcs12_export_to_file',
626
-            'openssl_pkcs12_read' => 'Safe\openssl_pkcs12_read',
627
-            'openssl_pkey_export' => 'Safe\openssl_pkey_export',
628
-            'openssl_pkey_export_to_file' => 'Safe\openssl_pkey_export_to_file',
629
-            'openssl_pkey_get_private' => 'Safe\openssl_pkey_get_private',
630
-            'openssl_pkey_get_public' => 'Safe\openssl_pkey_get_public',
631
-            'openssl_pkey_new' => 'Safe\openssl_pkey_new',
632
-            'openssl_private_decrypt' => 'Safe\openssl_private_decrypt',
633
-            'openssl_private_encrypt' => 'Safe\openssl_private_encrypt',
634
-            'openssl_public_decrypt' => 'Safe\openssl_public_decrypt',
635
-            'openssl_public_encrypt' => 'Safe\openssl_public_encrypt',
636
-            'openssl_random_pseudo_bytes' => 'Safe\openssl_random_pseudo_bytes',
637
-            'openssl_seal' => 'Safe\openssl_seal',
638
-            'openssl_sign' => 'Safe\openssl_sign',
639
-            'openssl_x509_export' => 'Safe\openssl_x509_export',
640
-            'openssl_x509_export_to_file' => 'Safe\openssl_x509_export_to_file',
641
-            'openssl_x509_fingerprint' => 'Safe\openssl_x509_fingerprint',
642
-            'openssl_x509_read' => 'Safe\openssl_x509_read',
643
-            'output_add_rewrite_var' => 'Safe\output_add_rewrite_var',
644
-            'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars',
645
-            'pack' => 'Safe\pack',
646
-            'parse_ini_file' => 'Safe\parse_ini_file',
647
-            'parse_ini_string' => 'Safe\parse_ini_string',
648
-            'parse_url' => 'Safe\parse_url',
649
-            'password_hash' => 'Safe\password_hash',
650
-            'pcntl_exec' => 'Safe\pcntl_exec',
651
-            'pcntl_getpriority' => 'Safe\pcntl_getpriority',
652
-            'pcntl_setpriority' => 'Safe\pcntl_setpriority',
653
-            'pcntl_signal_dispatch' => 'Safe\pcntl_signal_dispatch',
654
-            'pcntl_sigprocmask' => 'Safe\pcntl_sigprocmask',
655
-            'pcntl_strerror' => 'Safe\pcntl_strerror',
656
-            'PDF_activate_item' => 'Safe\PDF_activate_item',
657
-            'PDF_add_locallink' => 'Safe\PDF_add_locallink',
658
-            'PDF_add_nameddest' => 'Safe\PDF_add_nameddest',
659
-            'PDF_add_note' => 'Safe\PDF_add_note',
660
-            'PDF_add_pdflink' => 'Safe\PDF_add_pdflink',
661
-            'PDF_add_thumbnail' => 'Safe\PDF_add_thumbnail',
662
-            'PDF_add_weblink' => 'Safe\PDF_add_weblink',
663
-            'PDF_attach_file' => 'Safe\PDF_attach_file',
664
-            'PDF_begin_layer' => 'Safe\PDF_begin_layer',
665
-            'PDF_begin_page' => 'Safe\PDF_begin_page',
666
-            'PDF_begin_page_ext' => 'Safe\PDF_begin_page_ext',
667
-            'PDF_circle' => 'Safe\PDF_circle',
668
-            'PDF_clip' => 'Safe\PDF_clip',
669
-            'PDF_close' => 'Safe\PDF_close',
670
-            'PDF_closepath' => 'Safe\PDF_closepath',
671
-            'PDF_closepath_fill_stroke' => 'Safe\PDF_closepath_fill_stroke',
672
-            'PDF_closepath_stroke' => 'Safe\PDF_closepath_stroke',
673
-            'PDF_close_pdi' => 'Safe\PDF_close_pdi',
674
-            'PDF_close_pdi_page' => 'Safe\PDF_close_pdi_page',
675
-            'PDF_concat' => 'Safe\PDF_concat',
676
-            'PDF_continue_text' => 'Safe\PDF_continue_text',
677
-            'PDF_curveto' => 'Safe\PDF_curveto',
678
-            'PDF_delete' => 'Safe\PDF_delete',
679
-            'PDF_end_layer' => 'Safe\PDF_end_layer',
680
-            'PDF_end_page' => 'Safe\PDF_end_page',
681
-            'PDF_end_page_ext' => 'Safe\PDF_end_page_ext',
682
-            'PDF_end_pattern' => 'Safe\PDF_end_pattern',
683
-            'PDF_end_template' => 'Safe\PDF_end_template',
684
-            'PDF_fill' => 'Safe\PDF_fill',
685
-            'PDF_fill_stroke' => 'Safe\PDF_fill_stroke',
686
-            'PDF_fit_image' => 'Safe\PDF_fit_image',
687
-            'PDF_fit_pdi_page' => 'Safe\PDF_fit_pdi_page',
688
-            'PDF_fit_textline' => 'Safe\PDF_fit_textline',
689
-            'PDF_initgraphics' => 'Safe\PDF_initgraphics',
690
-            'PDF_lineto' => 'Safe\PDF_lineto',
691
-            'PDF_makespotcolor' => 'Safe\PDF_makespotcolor',
692
-            'PDF_moveto' => 'Safe\PDF_moveto',
693
-            'PDF_open_file' => 'Safe\PDF_open_file',
694
-            'PDF_place_image' => 'Safe\PDF_place_image',
695
-            'PDF_place_pdi_page' => 'Safe\PDF_place_pdi_page',
696
-            'PDF_rect' => 'Safe\PDF_rect',
697
-            'PDF_restore' => 'Safe\PDF_restore',
698
-            'PDF_rotate' => 'Safe\PDF_rotate',
699
-            'PDF_save' => 'Safe\PDF_save',
700
-            'PDF_scale' => 'Safe\PDF_scale',
701
-            'PDF_setcolor' => 'Safe\PDF_setcolor',
702
-            'PDF_setdash' => 'Safe\PDF_setdash',
703
-            'PDF_setdashpattern' => 'Safe\PDF_setdashpattern',
704
-            'PDF_setflat' => 'Safe\PDF_setflat',
705
-            'PDF_setfont' => 'Safe\PDF_setfont',
706
-            'PDF_setgray' => 'Safe\PDF_setgray',
707
-            'PDF_setgray_fill' => 'Safe\PDF_setgray_fill',
708
-            'PDF_setgray_stroke' => 'Safe\PDF_setgray_stroke',
709
-            'PDF_setlinejoin' => 'Safe\PDF_setlinejoin',
710
-            'PDF_setlinewidth' => 'Safe\PDF_setlinewidth',
711
-            'PDF_setmatrix' => 'Safe\PDF_setmatrix',
712
-            'PDF_setmiterlimit' => 'Safe\PDF_setmiterlimit',
713
-            'PDF_setrgbcolor' => 'Safe\PDF_setrgbcolor',
714
-            'PDF_setrgbcolor_fill' => 'Safe\PDF_setrgbcolor_fill',
715
-            'PDF_setrgbcolor_stroke' => 'Safe\PDF_setrgbcolor_stroke',
716
-            'PDF_set_border_color' => 'Safe\PDF_set_border_color',
717
-            'PDF_set_border_dash' => 'Safe\PDF_set_border_dash',
718
-            'PDF_set_border_style' => 'Safe\PDF_set_border_style',
719
-            'PDF_set_info' => 'Safe\PDF_set_info',
720
-            'PDF_set_layer_dependency' => 'Safe\PDF_set_layer_dependency',
721
-            'PDF_set_parameter' => 'Safe\PDF_set_parameter',
722
-            'PDF_set_text_pos' => 'Safe\PDF_set_text_pos',
723
-            'PDF_set_value' => 'Safe\PDF_set_value',
724
-            'PDF_show' => 'Safe\PDF_show',
725
-            'PDF_show_xy' => 'Safe\PDF_show_xy',
726
-            'PDF_skew' => 'Safe\PDF_skew',
727
-            'PDF_stroke' => 'Safe\PDF_stroke',
728
-            'pg_cancel_query' => 'Safe\pg_cancel_query',
729
-            'pg_client_encoding' => 'Safe\pg_client_encoding',
730
-            'pg_close' => 'Safe\pg_close',
731
-            'pg_connect' => 'Safe\pg_connect',
732
-            'pg_connection_reset' => 'Safe\pg_connection_reset',
733
-            'pg_convert' => 'Safe\pg_convert',
734
-            'pg_copy_from' => 'Safe\pg_copy_from',
735
-            'pg_copy_to' => 'Safe\pg_copy_to',
736
-            'pg_dbname' => 'Safe\pg_dbname',
737
-            'pg_delete' => 'Safe\pg_delete',
738
-            'pg_end_copy' => 'Safe\pg_end_copy',
739
-            'pg_execute' => 'Safe\pg_execute',
740
-            'pg_field_name' => 'Safe\pg_field_name',
741
-            'pg_field_table' => 'Safe\pg_field_table',
742
-            'pg_field_type' => 'Safe\pg_field_type',
743
-            'pg_flush' => 'Safe\pg_flush',
744
-            'pg_free_result' => 'Safe\pg_free_result',
745
-            'pg_host' => 'Safe\pg_host',
746
-            'pg_insert' => 'Safe\pg_insert',
747
-            'pg_last_error' => 'Safe\pg_last_error',
748
-            'pg_last_notice' => 'Safe\pg_last_notice',
749
-            'pg_last_oid' => 'Safe\pg_last_oid',
750
-            'pg_lo_close' => 'Safe\pg_lo_close',
751
-            'pg_lo_export' => 'Safe\pg_lo_export',
752
-            'pg_lo_import' => 'Safe\pg_lo_import',
753
-            'pg_lo_open' => 'Safe\pg_lo_open',
754
-            'pg_lo_read' => 'Safe\pg_lo_read',
755
-            'pg_lo_read_all' => 'Safe\pg_lo_read_all',
756
-            'pg_lo_seek' => 'Safe\pg_lo_seek',
757
-            'pg_lo_truncate' => 'Safe\pg_lo_truncate',
758
-            'pg_lo_unlink' => 'Safe\pg_lo_unlink',
759
-            'pg_lo_write' => 'Safe\pg_lo_write',
760
-            'pg_meta_data' => 'Safe\pg_meta_data',
761
-            'pg_options' => 'Safe\pg_options',
762
-            'pg_parameter_status' => 'Safe\pg_parameter_status',
763
-            'pg_pconnect' => 'Safe\pg_pconnect',
764
-            'pg_ping' => 'Safe\pg_ping',
765
-            'pg_port' => 'Safe\pg_port',
766
-            'pg_prepare' => 'Safe\pg_prepare',
767
-            'pg_put_line' => 'Safe\pg_put_line',
768
-            'pg_query' => 'Safe\pg_query',
769
-            'pg_query_params' => 'Safe\pg_query_params',
770
-            'pg_result_error_field' => 'Safe\pg_result_error_field',
771
-            'pg_result_seek' => 'Safe\pg_result_seek',
772
-            'pg_select' => 'Safe\pg_select',
773
-            'pg_send_execute' => 'Safe\pg_send_execute',
774
-            'pg_send_prepare' => 'Safe\pg_send_prepare',
775
-            'pg_send_query' => 'Safe\pg_send_query',
776
-            'pg_send_query_params' => 'Safe\pg_send_query_params',
777
-            'pg_socket' => 'Safe\pg_socket',
778
-            'pg_trace' => 'Safe\pg_trace',
779
-            'pg_tty' => 'Safe\pg_tty',
780
-            'pg_update' => 'Safe\pg_update',
781
-            'pg_version' => 'Safe\pg_version',
782
-            'phpcredits' => 'Safe\phpcredits',
783
-            'phpinfo' => 'Safe\phpinfo',
784
-            'png2wbmp' => 'Safe\png2wbmp',
785
-            'posix_access' => 'Safe\posix_access',
786
-            'posix_getgrnam' => 'Safe\posix_getgrnam',
787
-            'posix_getpgid' => 'Safe\posix_getpgid',
788
-            'posix_initgroups' => 'Safe\posix_initgroups',
789
-            'posix_kill' => 'Safe\posix_kill',
790
-            'posix_mkfifo' => 'Safe\posix_mkfifo',
791
-            'posix_mknod' => 'Safe\posix_mknod',
792
-            'posix_setegid' => 'Safe\posix_setegid',
793
-            'posix_seteuid' => 'Safe\posix_seteuid',
794
-            'posix_setgid' => 'Safe\posix_setgid',
795
-            'posix_setpgid' => 'Safe\posix_setpgid',
796
-            'posix_setrlimit' => 'Safe\posix_setrlimit',
797
-            'posix_setuid' => 'Safe\posix_setuid',
798
-            'preg_match' => 'Safe\preg_match',
799
-            'preg_match_all' => 'Safe\preg_match_all',
800
-            'preg_replace' => 'Safe\preg_replace',
801
-            'preg_split' => 'Safe\preg_split',
802
-            'proc_get_status' => 'Safe\proc_get_status',
803
-            'proc_nice' => 'Safe\proc_nice',
804
-            'pspell_add_to_personal' => 'Safe\pspell_add_to_personal',
805
-            'pspell_add_to_session' => 'Safe\pspell_add_to_session',
806
-            'pspell_clear_session' => 'Safe\pspell_clear_session',
807
-            'pspell_config_create' => 'Safe\pspell_config_create',
808
-            'pspell_config_data_dir' => 'Safe\pspell_config_data_dir',
809
-            'pspell_config_dict_dir' => 'Safe\pspell_config_dict_dir',
810
-            'pspell_config_ignore' => 'Safe\pspell_config_ignore',
811
-            'pspell_config_mode' => 'Safe\pspell_config_mode',
812
-            'pspell_config_personal' => 'Safe\pspell_config_personal',
813
-            'pspell_config_repl' => 'Safe\pspell_config_repl',
814
-            'pspell_config_runtogether' => 'Safe\pspell_config_runtogether',
815
-            'pspell_config_save_repl' => 'Safe\pspell_config_save_repl',
816
-            'pspell_new' => 'Safe\pspell_new',
817
-            'pspell_new_config' => 'Safe\pspell_new_config',
818
-            'pspell_save_wordlist' => 'Safe\pspell_save_wordlist',
819
-            'pspell_store_replacement' => 'Safe\pspell_store_replacement',
820
-            'ps_add_launchlink' => 'Safe\ps_add_launchlink',
821
-            'ps_add_locallink' => 'Safe\ps_add_locallink',
822
-            'ps_add_note' => 'Safe\ps_add_note',
823
-            'ps_add_pdflink' => 'Safe\ps_add_pdflink',
824
-            'ps_add_weblink' => 'Safe\ps_add_weblink',
825
-            'ps_arc' => 'Safe\ps_arc',
826
-            'ps_arcn' => 'Safe\ps_arcn',
827
-            'ps_begin_page' => 'Safe\ps_begin_page',
828
-            'ps_begin_pattern' => 'Safe\ps_begin_pattern',
829
-            'ps_begin_template' => 'Safe\ps_begin_template',
830
-            'ps_circle' => 'Safe\ps_circle',
831
-            'ps_clip' => 'Safe\ps_clip',
832
-            'ps_close' => 'Safe\ps_close',
833
-            'ps_closepath' => 'Safe\ps_closepath',
834
-            'ps_closepath_stroke' => 'Safe\ps_closepath_stroke',
835
-            'ps_close_image' => 'Safe\ps_close_image',
836
-            'ps_continue_text' => 'Safe\ps_continue_text',
837
-            'ps_curveto' => 'Safe\ps_curveto',
838
-            'ps_delete' => 'Safe\ps_delete',
839
-            'ps_end_page' => 'Safe\ps_end_page',
840
-            'ps_end_pattern' => 'Safe\ps_end_pattern',
841
-            'ps_end_template' => 'Safe\ps_end_template',
842
-            'ps_fill' => 'Safe\ps_fill',
843
-            'ps_fill_stroke' => 'Safe\ps_fill_stroke',
844
-            'ps_get_parameter' => 'Safe\ps_get_parameter',
845
-            'ps_hyphenate' => 'Safe\ps_hyphenate',
846
-            'ps_include_file' => 'Safe\ps_include_file',
847
-            'ps_lineto' => 'Safe\ps_lineto',
848
-            'ps_moveto' => 'Safe\ps_moveto',
849
-            'ps_new' => 'Safe\ps_new',
850
-            'ps_open_file' => 'Safe\ps_open_file',
851
-            'ps_place_image' => 'Safe\ps_place_image',
852
-            'ps_rect' => 'Safe\ps_rect',
853
-            'ps_restore' => 'Safe\ps_restore',
854
-            'ps_rotate' => 'Safe\ps_rotate',
855
-            'ps_save' => 'Safe\ps_save',
856
-            'ps_scale' => 'Safe\ps_scale',
857
-            'ps_setcolor' => 'Safe\ps_setcolor',
858
-            'ps_setdash' => 'Safe\ps_setdash',
859
-            'ps_setflat' => 'Safe\ps_setflat',
860
-            'ps_setfont' => 'Safe\ps_setfont',
861
-            'ps_setgray' => 'Safe\ps_setgray',
862
-            'ps_setlinecap' => 'Safe\ps_setlinecap',
863
-            'ps_setlinejoin' => 'Safe\ps_setlinejoin',
864
-            'ps_setlinewidth' => 'Safe\ps_setlinewidth',
865
-            'ps_setmiterlimit' => 'Safe\ps_setmiterlimit',
866
-            'ps_setoverprintmode' => 'Safe\ps_setoverprintmode',
867
-            'ps_setpolydash' => 'Safe\ps_setpolydash',
868
-            'ps_set_border_color' => 'Safe\ps_set_border_color',
869
-            'ps_set_border_dash' => 'Safe\ps_set_border_dash',
870
-            'ps_set_border_style' => 'Safe\ps_set_border_style',
871
-            'ps_set_info' => 'Safe\ps_set_info',
872
-            'ps_set_parameter' => 'Safe\ps_set_parameter',
873
-            'ps_set_text_pos' => 'Safe\ps_set_text_pos',
874
-            'ps_set_value' => 'Safe\ps_set_value',
875
-            'ps_shading' => 'Safe\ps_shading',
876
-            'ps_shading_pattern' => 'Safe\ps_shading_pattern',
877
-            'ps_shfill' => 'Safe\ps_shfill',
878
-            'ps_show' => 'Safe\ps_show',
879
-            'ps_show2' => 'Safe\ps_show2',
880
-            'ps_show_xy' => 'Safe\ps_show_xy',
881
-            'ps_show_xy2' => 'Safe\ps_show_xy2',
882
-            'ps_stroke' => 'Safe\ps_stroke',
883
-            'ps_symbol' => 'Safe\ps_symbol',
884
-            'ps_translate' => 'Safe\ps_translate',
885
-            'putenv' => 'Safe\putenv',
886
-            'readfile' => 'Safe\readfile',
887
-            'readgzfile' => 'Safe\readgzfile',
888
-            'readline_add_history' => 'Safe\readline_add_history',
889
-            'readline_callback_handler_install' => 'Safe\readline_callback_handler_install',
890
-            'readline_clear_history' => 'Safe\readline_clear_history',
891
-            'readline_completion_function' => 'Safe\readline_completion_function',
892
-            'readline_read_history' => 'Safe\readline_read_history',
893
-            'readline_write_history' => 'Safe\readline_write_history',
894
-            'readlink' => 'Safe\readlink',
895
-            'realpath' => 'Safe\realpath',
896
-            'register_tick_function' => 'Safe\register_tick_function',
897
-            'rename' => 'Safe\rename',
898
-            'rewind' => 'Safe\rewind',
899
-            'rewinddir' => 'Safe\rewinddir',
900
-            'rmdir' => 'Safe\rmdir',
901
-            'rpmaddtag' => 'Safe\rpmaddtag',
902
-            'rrd_create' => 'Safe\rrd_create',
903
-            'rsort' => 'Safe\rsort',
904
-            'sapi_windows_cp_conv' => 'Safe\sapi_windows_cp_conv',
905
-            'sapi_windows_cp_set' => 'Safe\sapi_windows_cp_set',
906
-            'sapi_windows_generate_ctrl_event' => 'Safe\sapi_windows_generate_ctrl_event',
907
-            'sapi_windows_vt100_support' => 'Safe\sapi_windows_vt100_support',
908
-            'scandir' => 'Safe\scandir',
909
-            'sem_acquire' => 'Safe\sem_acquire',
910
-            'sem_get' => 'Safe\sem_get',
911
-            'sem_release' => 'Safe\sem_release',
912
-            'sem_remove' => 'Safe\sem_remove',
913
-            'session_abort' => 'Safe\session_abort',
914
-            'session_decode' => 'Safe\session_decode',
915
-            'session_destroy' => 'Safe\session_destroy',
916
-            'session_regenerate_id' => 'Safe\session_regenerate_id',
917
-            'session_reset' => 'Safe\session_reset',
918
-            'session_unset' => 'Safe\session_unset',
919
-            'session_write_close' => 'Safe\session_write_close',
920
-            'settype' => 'Safe\settype',
921
-            'set_include_path' => 'Safe\set_include_path',
922
-            'set_time_limit' => 'Safe\set_time_limit',
923
-            'sha1_file' => 'Safe\sha1_file',
924
-            'shmop_delete' => 'Safe\shmop_delete',
925
-            'shmop_read' => 'Safe\shmop_read',
926
-            'shmop_write' => 'Safe\shmop_write',
927
-            'shm_put_var' => 'Safe\shm_put_var',
928
-            'shm_remove' => 'Safe\shm_remove',
929
-            'shm_remove_var' => 'Safe\shm_remove_var',
930
-            'shuffle' => 'Safe\shuffle',
931
-            'simplexml_import_dom' => 'Safe\simplexml_import_dom',
932
-            'simplexml_load_file' => 'Safe\simplexml_load_file',
933
-            'simplexml_load_string' => 'Safe\simplexml_load_string',
934
-            'sleep' => 'Safe\sleep',
935
-            'socket_accept' => 'Safe\socket_accept',
936
-            'socket_addrinfo_bind' => 'Safe\socket_addrinfo_bind',
937
-            'socket_addrinfo_connect' => 'Safe\socket_addrinfo_connect',
938
-            'socket_bind' => 'Safe\socket_bind',
939
-            'socket_connect' => 'Safe\socket_connect',
940
-            'socket_create' => 'Safe\socket_create',
941
-            'socket_create_listen' => 'Safe\socket_create_listen',
942
-            'socket_create_pair' => 'Safe\socket_create_pair',
943
-            'socket_export_stream' => 'Safe\socket_export_stream',
944
-            'socket_getpeername' => 'Safe\socket_getpeername',
945
-            'socket_getsockname' => 'Safe\socket_getsockname',
946
-            'socket_get_option' => 'Safe\socket_get_option',
947
-            'socket_import_stream' => 'Safe\socket_import_stream',
948
-            'socket_listen' => 'Safe\socket_listen',
949
-            'socket_read' => 'Safe\socket_read',
950
-            'socket_send' => 'Safe\socket_send',
951
-            'socket_sendmsg' => 'Safe\socket_sendmsg',
952
-            'socket_sendto' => 'Safe\socket_sendto',
953
-            'socket_set_block' => 'Safe\socket_set_block',
954
-            'socket_set_nonblock' => 'Safe\socket_set_nonblock',
955
-            'socket_set_option' => 'Safe\socket_set_option',
956
-            'socket_shutdown' => 'Safe\socket_shutdown',
957
-            'socket_write' => 'Safe\socket_write',
958
-            'socket_wsaprotocol_info_export' => 'Safe\socket_wsaprotocol_info_export',
959
-            'socket_wsaprotocol_info_import' => 'Safe\socket_wsaprotocol_info_import',
960
-            'socket_wsaprotocol_info_release' => 'Safe\socket_wsaprotocol_info_release',
961
-            'sodium_crypto_pwhash' => 'Safe\sodium_crypto_pwhash',
962
-            'sodium_crypto_pwhash_str' => 'Safe\sodium_crypto_pwhash_str',
963
-            'solr_get_version' => 'Safe\solr_get_version',
964
-            'sort' => 'Safe\sort',
965
-            'soundex' => 'Safe\soundex',
966
-            'spl_autoload_register' => 'Safe\spl_autoload_register',
967
-            'spl_autoload_unregister' => 'Safe\spl_autoload_unregister',
968
-            'sprintf' => 'Safe\sprintf',
969
-            'sqlsrv_begin_transaction' => 'Safe\sqlsrv_begin_transaction',
970
-            'sqlsrv_cancel' => 'Safe\sqlsrv_cancel',
971
-            'sqlsrv_client_info' => 'Safe\sqlsrv_client_info',
972
-            'sqlsrv_close' => 'Safe\sqlsrv_close',
973
-            'sqlsrv_commit' => 'Safe\sqlsrv_commit',
974
-            'sqlsrv_configure' => 'Safe\sqlsrv_configure',
975
-            'sqlsrv_execute' => 'Safe\sqlsrv_execute',
976
-            'sqlsrv_free_stmt' => 'Safe\sqlsrv_free_stmt',
977
-            'sqlsrv_get_field' => 'Safe\sqlsrv_get_field',
978
-            'sqlsrv_next_result' => 'Safe\sqlsrv_next_result',
979
-            'sqlsrv_num_fields' => 'Safe\sqlsrv_num_fields',
980
-            'sqlsrv_num_rows' => 'Safe\sqlsrv_num_rows',
981
-            'sqlsrv_prepare' => 'Safe\sqlsrv_prepare',
982
-            'sqlsrv_query' => 'Safe\sqlsrv_query',
983
-            'sqlsrv_rollback' => 'Safe\sqlsrv_rollback',
984
-            'ssdeep_fuzzy_compare' => 'Safe\ssdeep_fuzzy_compare',
985
-            'ssdeep_fuzzy_hash' => 'Safe\ssdeep_fuzzy_hash',
986
-            'ssdeep_fuzzy_hash_filename' => 'Safe\ssdeep_fuzzy_hash_filename',
987
-            'ssh2_auth_agent' => 'Safe\ssh2_auth_agent',
988
-            'ssh2_auth_hostbased_file' => 'Safe\ssh2_auth_hostbased_file',
989
-            'ssh2_auth_password' => 'Safe\ssh2_auth_password',
990
-            'ssh2_auth_pubkey_file' => 'Safe\ssh2_auth_pubkey_file',
991
-            'ssh2_connect' => 'Safe\ssh2_connect',
992
-            'ssh2_disconnect' => 'Safe\ssh2_disconnect',
993
-            'ssh2_exec' => 'Safe\ssh2_exec',
994
-            'ssh2_publickey_add' => 'Safe\ssh2_publickey_add',
995
-            'ssh2_publickey_init' => 'Safe\ssh2_publickey_init',
996
-            'ssh2_publickey_remove' => 'Safe\ssh2_publickey_remove',
997
-            'ssh2_scp_recv' => 'Safe\ssh2_scp_recv',
998
-            'ssh2_scp_send' => 'Safe\ssh2_scp_send',
999
-            'ssh2_sftp' => 'Safe\ssh2_sftp',
1000
-            'ssh2_sftp_chmod' => 'Safe\ssh2_sftp_chmod',
1001
-            'ssh2_sftp_mkdir' => 'Safe\ssh2_sftp_mkdir',
1002
-            'ssh2_sftp_rename' => 'Safe\ssh2_sftp_rename',
1003
-            'ssh2_sftp_rmdir' => 'Safe\ssh2_sftp_rmdir',
1004
-            'ssh2_sftp_symlink' => 'Safe\ssh2_sftp_symlink',
1005
-            'ssh2_sftp_unlink' => 'Safe\ssh2_sftp_unlink',
1006
-            'stream_context_set_params' => 'Safe\stream_context_set_params',
1007
-            'stream_copy_to_stream' => 'Safe\stream_copy_to_stream',
1008
-            'stream_filter_append' => 'Safe\stream_filter_append',
1009
-            'stream_filter_prepend' => 'Safe\stream_filter_prepend',
1010
-            'stream_filter_register' => 'Safe\stream_filter_register',
1011
-            'stream_filter_remove' => 'Safe\stream_filter_remove',
1012
-            'stream_get_contents' => 'Safe\stream_get_contents',
1013
-            'stream_isatty' => 'Safe\stream_isatty',
1014
-            'stream_resolve_include_path' => 'Safe\stream_resolve_include_path',
1015
-            'stream_set_blocking' => 'Safe\stream_set_blocking',
1016
-            'stream_set_timeout' => 'Safe\stream_set_timeout',
1017
-            'stream_socket_accept' => 'Safe\stream_socket_accept',
1018
-            'stream_socket_client' => 'Safe\stream_socket_client',
1019
-            'stream_socket_pair' => 'Safe\stream_socket_pair',
1020
-            'stream_socket_server' => 'Safe\stream_socket_server',
1021
-            'stream_socket_shutdown' => 'Safe\stream_socket_shutdown',
1022
-            'stream_supports_lock' => 'Safe\stream_supports_lock',
1023
-            'stream_wrapper_register' => 'Safe\stream_wrapper_register',
1024
-            'stream_wrapper_restore' => 'Safe\stream_wrapper_restore',
1025
-            'stream_wrapper_unregister' => 'Safe\stream_wrapper_unregister',
1026
-            'strptime' => 'Safe\strptime',
1027
-            'strtotime' => 'Safe\strtotime',
1028
-            'substr' => 'Safe\substr',
1029
-            'swoole_async_write' => 'Safe\swoole_async_write',
1030
-            'swoole_async_writefile' => 'Safe\swoole_async_writefile',
1031
-            'swoole_event_defer' => 'Safe\swoole_event_defer',
1032
-            'swoole_event_del' => 'Safe\swoole_event_del',
1033
-            'swoole_event_write' => 'Safe\swoole_event_write',
1034
-            'symlink' => 'Safe\symlink',
1035
-            'syslog' => 'Safe\syslog',
1036
-            'system' => 'Safe\system',
1037
-            'tempnam' => 'Safe\tempnam',
1038
-            'timezone_name_from_abbr' => 'Safe\timezone_name_from_abbr',
1039
-            'time_nanosleep' => 'Safe\time_nanosleep',
1040
-            'time_sleep_until' => 'Safe\time_sleep_until',
1041
-            'tmpfile' => 'Safe\tmpfile',
1042
-            'touch' => 'Safe\touch',
1043
-            'uasort' => 'Safe\uasort',
1044
-            'uksort' => 'Safe\uksort',
1045
-            'unlink' => 'Safe\unlink',
1046
-            'unpack' => 'Safe\unpack',
1047
-            'uopz_extend' => 'Safe\uopz_extend',
1048
-            'uopz_implement' => 'Safe\uopz_implement',
1049
-            'usort' => 'Safe\usort',
1050
-            'virtual' => 'Safe\virtual',
1051
-            'vsprintf' => 'Safe\vsprintf',
1052
-            'xdiff_file_bdiff' => 'Safe\xdiff_file_bdiff',
1053
-            'xdiff_file_bpatch' => 'Safe\xdiff_file_bpatch',
1054
-            'xdiff_file_diff' => 'Safe\xdiff_file_diff',
1055
-            'xdiff_file_diff_binary' => 'Safe\xdiff_file_diff_binary',
1056
-            'xdiff_file_patch_binary' => 'Safe\xdiff_file_patch_binary',
1057
-            'xdiff_file_rabdiff' => 'Safe\xdiff_file_rabdiff',
1058
-            'xdiff_string_bpatch' => 'Safe\xdiff_string_bpatch',
1059
-            'xdiff_string_patch' => 'Safe\xdiff_string_patch',
1060
-            'xdiff_string_patch_binary' => 'Safe\xdiff_string_patch_binary',
1061
-            'xmlrpc_set_type' => 'Safe\xmlrpc_set_type',
1062
-            'xml_parser_create' => 'Safe\xml_parser_create',
1063
-            'xml_parser_create_ns' => 'Safe\xml_parser_create_ns',
1064
-            'xml_set_object' => 'Safe\xml_set_object',
1065
-            'yaml_parse' => 'Safe\yaml_parse',
1066
-            'yaml_parse_file' => 'Safe\yaml_parse_file',
1067
-            'yaml_parse_url' => 'Safe\yaml_parse_url',
1068
-            'yaz_ccl_parse' => 'Safe\yaz_ccl_parse',
1069
-            'yaz_close' => 'Safe\yaz_close',
1070
-            'yaz_connect' => 'Safe\yaz_connect',
1071
-            'yaz_database' => 'Safe\yaz_database',
1072
-            'yaz_element' => 'Safe\yaz_element',
1073
-            'yaz_present' => 'Safe\yaz_present',
1074
-            'yaz_search' => 'Safe\yaz_search',
1075
-            'yaz_wait' => 'Safe\yaz_wait',
1076
-            'zip_entry_close' => 'Safe\zip_entry_close',
1077
-            'zip_entry_open' => 'Safe\zip_entry_open',
1078
-            'zip_entry_read' => 'Safe\zip_entry_read',
1079
-            'zlib_decode' => 'Safe\zlib_decode',
12
+	$services->set(RenameFunctionRector::class)
13
+		->call('configure', [[ RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [
14
+			'apache_getenv' => 'Safe\apache_getenv',
15
+			'apache_get_version' => 'Safe\apache_get_version',
16
+			'apache_request_headers' => 'Safe\apache_request_headers',
17
+			'apache_reset_timeout' => 'Safe\apache_reset_timeout',
18
+			'apache_response_headers' => 'Safe\apache_response_headers',
19
+			'apache_setenv' => 'Safe\apache_setenv',
20
+			'apcu_cache_info' => 'Safe\apcu_cache_info',
21
+			'apcu_cas' => 'Safe\apcu_cas',
22
+			'apcu_dec' => 'Safe\apcu_dec',
23
+			'apcu_fetch' => 'Safe\apcu_fetch',
24
+			'apcu_inc' => 'Safe\apcu_inc',
25
+			'apcu_sma_info' => 'Safe\apcu_sma_info',
26
+			'apc_fetch' => 'Safe\apc_fetch',
27
+			'array_combine' => 'Safe\array_combine',
28
+			'array_flip' => 'Safe\array_flip',
29
+			'array_replace' => 'Safe\array_replace',
30
+			'array_replace_recursive' => 'Safe\array_replace_recursive',
31
+			'array_walk_recursive' => 'Safe\array_walk_recursive',
32
+			'arsort' => 'Safe\arsort',
33
+			'asort' => 'Safe\asort',
34
+			'base64_decode' => 'Safe\base64_decode',
35
+			'bzclose' => 'Safe\bzclose',
36
+			'bzflush' => 'Safe\bzflush',
37
+			'bzread' => 'Safe\bzread',
38
+			'bzwrite' => 'Safe\bzwrite',
39
+			'chdir' => 'Safe\chdir',
40
+			'chgrp' => 'Safe\chgrp',
41
+			'chmod' => 'Safe\chmod',
42
+			'chown' => 'Safe\chown',
43
+			'chroot' => 'Safe\chroot',
44
+			'class_alias' => 'Safe\class_alias',
45
+			'class_implements' => 'Safe\class_implements',
46
+			'class_parents' => 'Safe\class_parents',
47
+			'class_uses' => 'Safe\class_uses',
48
+			'cli_set_process_title' => 'Safe\cli_set_process_title',
49
+			'closelog' => 'Safe\closelog',
50
+			'com_event_sink' => 'Safe\com_event_sink',
51
+			'com_load_typelib' => 'Safe\com_load_typelib',
52
+			'com_print_typeinfo' => 'Safe\com_print_typeinfo',
53
+			'convert_uudecode' => 'Safe\convert_uudecode',
54
+			'convert_uuencode' => 'Safe\convert_uuencode',
55
+			'copy' => 'Safe\copy',
56
+			'create_function' => 'Safe\create_function',
57
+			'cubrid_free_result' => 'Safe\cubrid_free_result',
58
+			'cubrid_get_charset' => 'Safe\cubrid_get_charset',
59
+			'cubrid_get_client_info' => 'Safe\cubrid_get_client_info',
60
+			'cubrid_get_db_parameter' => 'Safe\cubrid_get_db_parameter',
61
+			'cubrid_get_server_info' => 'Safe\cubrid_get_server_info',
62
+			'cubrid_insert_id' => 'Safe\cubrid_insert_id',
63
+			'cubrid_lob2_new' => 'Safe\cubrid_lob2_new',
64
+			'cubrid_lob2_size' => 'Safe\cubrid_lob2_size',
65
+			'cubrid_lob2_size64' => 'Safe\cubrid_lob2_size64',
66
+			'cubrid_lob2_tell' => 'Safe\cubrid_lob2_tell',
67
+			'cubrid_lob2_tell64' => 'Safe\cubrid_lob2_tell64',
68
+			'cubrid_set_db_parameter' => 'Safe\cubrid_set_db_parameter',
69
+			'curl_escape' => 'Safe\curl_escape',
70
+			'curl_exec' => 'Safe\curl_exec',
71
+			'curl_getinfo' => 'Safe\curl_getinfo',
72
+			'curl_init' => 'Safe\curl_init',
73
+			'curl_multi_errno' => 'Safe\curl_multi_errno',
74
+			'curl_multi_info_read' => 'Safe\curl_multi_info_read',
75
+			'curl_multi_init' => 'Safe\curl_multi_init',
76
+			'curl_setopt' => 'Safe\curl_setopt',
77
+			'curl_share_errno' => 'Safe\curl_share_errno',
78
+			'curl_share_setopt' => 'Safe\curl_share_setopt',
79
+			'curl_unescape' => 'Safe\curl_unescape',
80
+			'date' => 'Safe\date',
81
+			'date_parse' => 'Safe\date_parse',
82
+			'date_parse_from_format' => 'Safe\date_parse_from_format',
83
+			'date_sunrise' => 'Safe\date_sunrise',
84
+			'date_sunset' => 'Safe\date_sunset',
85
+			'date_sun_info' => 'Safe\date_sun_info',
86
+			'db2_autocommit' => 'Safe\db2_autocommit',
87
+			'db2_bind_param' => 'Safe\db2_bind_param',
88
+			'db2_client_info' => 'Safe\db2_client_info',
89
+			'db2_close' => 'Safe\db2_close',
90
+			'db2_commit' => 'Safe\db2_commit',
91
+			'db2_execute' => 'Safe\db2_execute',
92
+			'db2_free_result' => 'Safe\db2_free_result',
93
+			'db2_free_stmt' => 'Safe\db2_free_stmt',
94
+			'db2_get_option' => 'Safe\db2_get_option',
95
+			'db2_pclose' => 'Safe\db2_pclose',
96
+			'db2_rollback' => 'Safe\db2_rollback',
97
+			'db2_server_info' => 'Safe\db2_server_info',
98
+			'db2_set_option' => 'Safe\db2_set_option',
99
+			'define' => 'Safe\define',
100
+			'deflate_add' => 'Safe\deflate_add',
101
+			'deflate_init' => 'Safe\deflate_init',
102
+			'disk_free_space' => 'Safe\disk_free_space',
103
+			'disk_total_space' => 'Safe\disk_total_space',
104
+			'dl' => 'Safe\dl',
105
+			'dns_get_record' => 'Safe\dns_get_record',
106
+			'eio_busy' => 'Safe\eio_busy',
107
+			'eio_chmod' => 'Safe\eio_chmod',
108
+			'eio_chown' => 'Safe\eio_chown',
109
+			'eio_close' => 'Safe\eio_close',
110
+			'eio_custom' => 'Safe\eio_custom',
111
+			'eio_dup2' => 'Safe\eio_dup2',
112
+			'eio_event_loop' => 'Safe\eio_event_loop',
113
+			'eio_fallocate' => 'Safe\eio_fallocate',
114
+			'eio_fchmod' => 'Safe\eio_fchmod',
115
+			'eio_fdatasync' => 'Safe\eio_fdatasync',
116
+			'eio_fstat' => 'Safe\eio_fstat',
117
+			'eio_fstatvfs' => 'Safe\eio_fstatvfs',
118
+			'eio_fsync' => 'Safe\eio_fsync',
119
+			'eio_ftruncate' => 'Safe\eio_ftruncate',
120
+			'eio_futime' => 'Safe\eio_futime',
121
+			'eio_grp' => 'Safe\eio_grp',
122
+			'eio_lstat' => 'Safe\eio_lstat',
123
+			'eio_mkdir' => 'Safe\eio_mkdir',
124
+			'eio_mknod' => 'Safe\eio_mknod',
125
+			'eio_nop' => 'Safe\eio_nop',
126
+			'eio_readahead' => 'Safe\eio_readahead',
127
+			'eio_readdir' => 'Safe\eio_readdir',
128
+			'eio_readlink' => 'Safe\eio_readlink',
129
+			'eio_rename' => 'Safe\eio_rename',
130
+			'eio_rmdir' => 'Safe\eio_rmdir',
131
+			'eio_seek' => 'Safe\eio_seek',
132
+			'eio_sendfile' => 'Safe\eio_sendfile',
133
+			'eio_stat' => 'Safe\eio_stat',
134
+			'eio_statvfs' => 'Safe\eio_statvfs',
135
+			'eio_symlink' => 'Safe\eio_symlink',
136
+			'eio_sync' => 'Safe\eio_sync',
137
+			'eio_syncfs' => 'Safe\eio_syncfs',
138
+			'eio_sync_file_range' => 'Safe\eio_sync_file_range',
139
+			'eio_truncate' => 'Safe\eio_truncate',
140
+			'eio_unlink' => 'Safe\eio_unlink',
141
+			'eio_utime' => 'Safe\eio_utime',
142
+			'eio_write' => 'Safe\eio_write',
143
+			'error_log' => 'Safe\error_log',
144
+			'fastcgi_finish_request' => 'Safe\fastcgi_finish_request',
145
+			'fbird_blob_cancel' => 'Safe\fbird_blob_cancel',
146
+			'fclose' => 'Safe\fclose',
147
+			'fflush' => 'Safe\fflush',
148
+			'file' => 'Safe\file',
149
+			'fileatime' => 'Safe\fileatime',
150
+			'filectime' => 'Safe\filectime',
151
+			'fileinode' => 'Safe\fileinode',
152
+			'filemtime' => 'Safe\filemtime',
153
+			'fileowner' => 'Safe\fileowner',
154
+			'filesize' => 'Safe\filesize',
155
+			'file_get_contents' => 'Safe\file_get_contents',
156
+			'file_put_contents' => 'Safe\file_put_contents',
157
+			'filter_input_array' => 'Safe\filter_input_array',
158
+			'filter_var_array' => 'Safe\filter_var_array',
159
+			'finfo_close' => 'Safe\finfo_close',
160
+			'finfo_open' => 'Safe\finfo_open',
161
+			'flock' => 'Safe\flock',
162
+			'fopen' => 'Safe\fopen',
163
+			'fputcsv' => 'Safe\fputcsv',
164
+			'fread' => 'Safe\fread',
165
+			'fsockopen' => 'Safe\fsockopen',
166
+			'ftp_alloc' => 'Safe\ftp_alloc',
167
+			'ftp_append' => 'Safe\ftp_append',
168
+			'ftp_cdup' => 'Safe\ftp_cdup',
169
+			'ftp_chdir' => 'Safe\ftp_chdir',
170
+			'ftp_chmod' => 'Safe\ftp_chmod',
171
+			'ftp_close' => 'Safe\ftp_close',
172
+			'ftp_connect' => 'Safe\ftp_connect',
173
+			'ftp_delete' => 'Safe\ftp_delete',
174
+			'ftp_fget' => 'Safe\ftp_fget',
175
+			'ftp_fput' => 'Safe\ftp_fput',
176
+			'ftp_get' => 'Safe\ftp_get',
177
+			'ftp_login' => 'Safe\ftp_login',
178
+			'ftp_mkdir' => 'Safe\ftp_mkdir',
179
+			'ftp_mlsd' => 'Safe\ftp_mlsd',
180
+			'ftp_nlist' => 'Safe\ftp_nlist',
181
+			'ftp_pasv' => 'Safe\ftp_pasv',
182
+			'ftp_put' => 'Safe\ftp_put',
183
+			'ftp_pwd' => 'Safe\ftp_pwd',
184
+			'ftp_rename' => 'Safe\ftp_rename',
185
+			'ftp_rmdir' => 'Safe\ftp_rmdir',
186
+			'ftp_site' => 'Safe\ftp_site',
187
+			'ftp_ssl_connect' => 'Safe\ftp_ssl_connect',
188
+			'ftp_systype' => 'Safe\ftp_systype',
189
+			'ftruncate' => 'Safe\ftruncate',
190
+			'fwrite' => 'Safe\fwrite',
191
+			'getallheaders' => 'Safe\getallheaders',
192
+			'getcwd' => 'Safe\getcwd',
193
+			'gethostname' => 'Safe\gethostname',
194
+			'getimagesize' => 'Safe\getimagesize',
195
+			'getlastmod' => 'Safe\getlastmod',
196
+			'getmygid' => 'Safe\getmygid',
197
+			'getmyinode' => 'Safe\getmyinode',
198
+			'getmypid' => 'Safe\getmypid',
199
+			'getmyuid' => 'Safe\getmyuid',
200
+			'getopt' => 'Safe\getopt',
201
+			'getprotobyname' => 'Safe\getprotobyname',
202
+			'getprotobynumber' => 'Safe\getprotobynumber',
203
+			'get_headers' => 'Safe\get_headers',
204
+			'glob' => 'Safe\glob',
205
+			'gmdate' => 'Safe\gmdate',
206
+			'gmp_binomial' => 'Safe\gmp_binomial',
207
+			'gmp_export' => 'Safe\gmp_export',
208
+			'gmp_import' => 'Safe\gmp_import',
209
+			'gmp_random_seed' => 'Safe\gmp_random_seed',
210
+			'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey',
211
+			'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey',
212
+			'gnupg_addsignkey' => 'Safe\gnupg_addsignkey',
213
+			'gnupg_cleardecryptkeys' => 'Safe\gnupg_cleardecryptkeys',
214
+			'gnupg_clearencryptkeys' => 'Safe\gnupg_clearencryptkeys',
215
+			'gnupg_clearsignkeys' => 'Safe\gnupg_clearsignkeys',
216
+			'gnupg_setarmor' => 'Safe\gnupg_setarmor',
217
+			'gnupg_setsignmode' => 'Safe\gnupg_setsignmode',
218
+			'gzclose' => 'Safe\gzclose',
219
+			'gzcompress' => 'Safe\gzcompress',
220
+			'gzdecode' => 'Safe\gzdecode',
221
+			'gzdeflate' => 'Safe\gzdeflate',
222
+			'gzencode' => 'Safe\gzencode',
223
+			'gzgets' => 'Safe\gzgets',
224
+			'gzgetss' => 'Safe\gzgetss',
225
+			'gzinflate' => 'Safe\gzinflate',
226
+			'gzpassthru' => 'Safe\gzpassthru',
227
+			'gzrewind' => 'Safe\gzrewind',
228
+			'gzuncompress' => 'Safe\gzuncompress',
229
+			'hash_hkdf' => 'Safe\hash_hkdf',
230
+			'hash_update_file' => 'Safe\hash_update_file',
231
+			'header_register_callback' => 'Safe\header_register_callback',
232
+			'hex2bin' => 'Safe\hex2bin',
233
+			'highlight_file' => 'Safe\highlight_file',
234
+			'highlight_string' => 'Safe\highlight_string',
235
+			'ibase_add_user' => 'Safe\ibase_add_user',
236
+			'ibase_backup' => 'Safe\ibase_backup',
237
+			'ibase_blob_cancel' => 'Safe\ibase_blob_cancel',
238
+			'ibase_blob_create' => 'Safe\ibase_blob_create',
239
+			'ibase_blob_get' => 'Safe\ibase_blob_get',
240
+			'ibase_close' => 'Safe\ibase_close',
241
+			'ibase_commit' => 'Safe\ibase_commit',
242
+			'ibase_commit_ret' => 'Safe\ibase_commit_ret',
243
+			'ibase_connect' => 'Safe\ibase_connect',
244
+			'ibase_delete_user' => 'Safe\ibase_delete_user',
245
+			'ibase_drop_db' => 'Safe\ibase_drop_db',
246
+			'ibase_free_event_handler' => 'Safe\ibase_free_event_handler',
247
+			'ibase_free_query' => 'Safe\ibase_free_query',
248
+			'ibase_free_result' => 'Safe\ibase_free_result',
249
+			'ibase_maintain_db' => 'Safe\ibase_maintain_db',
250
+			'ibase_modify_user' => 'Safe\ibase_modify_user',
251
+			'ibase_name_result' => 'Safe\ibase_name_result',
252
+			'ibase_pconnect' => 'Safe\ibase_pconnect',
253
+			'ibase_restore' => 'Safe\ibase_restore',
254
+			'ibase_rollback' => 'Safe\ibase_rollback',
255
+			'ibase_rollback_ret' => 'Safe\ibase_rollback_ret',
256
+			'ibase_service_attach' => 'Safe\ibase_service_attach',
257
+			'ibase_service_detach' => 'Safe\ibase_service_detach',
258
+			'iconv' => 'Safe\iconv',
259
+			'iconv_get_encoding' => 'Safe\iconv_get_encoding',
260
+			'iconv_set_encoding' => 'Safe\iconv_set_encoding',
261
+			'image2wbmp' => 'Safe\image2wbmp',
262
+			'imageaffine' => 'Safe\imageaffine',
263
+			'imageaffinematrixconcat' => 'Safe\imageaffinematrixconcat',
264
+			'imageaffinematrixget' => 'Safe\imageaffinematrixget',
265
+			'imagealphablending' => 'Safe\imagealphablending',
266
+			'imageantialias' => 'Safe\imageantialias',
267
+			'imagearc' => 'Safe\imagearc',
268
+			'imagebmp' => 'Safe\imagebmp',
269
+			'imagechar' => 'Safe\imagechar',
270
+			'imagecharup' => 'Safe\imagecharup',
271
+			'imagecolorat' => 'Safe\imagecolorat',
272
+			'imagecolordeallocate' => 'Safe\imagecolordeallocate',
273
+			'imagecolormatch' => 'Safe\imagecolormatch',
274
+			'imageconvolution' => 'Safe\imageconvolution',
275
+			'imagecopy' => 'Safe\imagecopy',
276
+			'imagecopymerge' => 'Safe\imagecopymerge',
277
+			'imagecopymergegray' => 'Safe\imagecopymergegray',
278
+			'imagecopyresampled' => 'Safe\imagecopyresampled',
279
+			'imagecopyresized' => 'Safe\imagecopyresized',
280
+			'imagecreate' => 'Safe\imagecreate',
281
+			'imagecreatefrombmp' => 'Safe\imagecreatefrombmp',
282
+			'imagecreatefromgd' => 'Safe\imagecreatefromgd',
283
+			'imagecreatefromgd2' => 'Safe\imagecreatefromgd2',
284
+			'imagecreatefromgd2part' => 'Safe\imagecreatefromgd2part',
285
+			'imagecreatefromgif' => 'Safe\imagecreatefromgif',
286
+			'imagecreatefromjpeg' => 'Safe\imagecreatefromjpeg',
287
+			'imagecreatefrompng' => 'Safe\imagecreatefrompng',
288
+			'imagecreatefromwbmp' => 'Safe\imagecreatefromwbmp',
289
+			'imagecreatefromwebp' => 'Safe\imagecreatefromwebp',
290
+			'imagecreatefromxbm' => 'Safe\imagecreatefromxbm',
291
+			'imagecreatefromxpm' => 'Safe\imagecreatefromxpm',
292
+			'imagecreatetruecolor' => 'Safe\imagecreatetruecolor',
293
+			'imagecrop' => 'Safe\imagecrop',
294
+			'imagecropauto' => 'Safe\imagecropauto',
295
+			'imagedashedline' => 'Safe\imagedashedline',
296
+			'imagedestroy' => 'Safe\imagedestroy',
297
+			'imageellipse' => 'Safe\imageellipse',
298
+			'imagefill' => 'Safe\imagefill',
299
+			'imagefilledarc' => 'Safe\imagefilledarc',
300
+			'imagefilledellipse' => 'Safe\imagefilledellipse',
301
+			'imagefilledpolygon' => 'Safe\imagefilledpolygon',
302
+			'imagefilledrectangle' => 'Safe\imagefilledrectangle',
303
+			'imagefilltoborder' => 'Safe\imagefilltoborder',
304
+			'imagefilter' => 'Safe\imagefilter',
305
+			'imageflip' => 'Safe\imageflip',
306
+			'imagegammacorrect' => 'Safe\imagegammacorrect',
307
+			'imagegd' => 'Safe\imagegd',
308
+			'imagegd2' => 'Safe\imagegd2',
309
+			'imagegif' => 'Safe\imagegif',
310
+			'imagegrabscreen' => 'Safe\imagegrabscreen',
311
+			'imagegrabwindow' => 'Safe\imagegrabwindow',
312
+			'imagejpeg' => 'Safe\imagejpeg',
313
+			'imagelayereffect' => 'Safe\imagelayereffect',
314
+			'imageline' => 'Safe\imageline',
315
+			'imageloadfont' => 'Safe\imageloadfont',
316
+			'imageopenpolygon' => 'Safe\imageopenpolygon',
317
+			'imagepng' => 'Safe\imagepng',
318
+			'imagepolygon' => 'Safe\imagepolygon',
319
+			'imagerectangle' => 'Safe\imagerectangle',
320
+			'imagerotate' => 'Safe\imagerotate',
321
+			'imagesavealpha' => 'Safe\imagesavealpha',
322
+			'imagescale' => 'Safe\imagescale',
323
+			'imagesetbrush' => 'Safe\imagesetbrush',
324
+			'imagesetclip' => 'Safe\imagesetclip',
325
+			'imagesetinterpolation' => 'Safe\imagesetinterpolation',
326
+			'imagesetpixel' => 'Safe\imagesetpixel',
327
+			'imagesetstyle' => 'Safe\imagesetstyle',
328
+			'imagesetthickness' => 'Safe\imagesetthickness',
329
+			'imagesettile' => 'Safe\imagesettile',
330
+			'imagestring' => 'Safe\imagestring',
331
+			'imagestringup' => 'Safe\imagestringup',
332
+			'imagesx' => 'Safe\imagesx',
333
+			'imagesy' => 'Safe\imagesy',
334
+			'imagetruecolortopalette' => 'Safe\imagetruecolortopalette',
335
+			'imagettfbbox' => 'Safe\imagettfbbox',
336
+			'imagettftext' => 'Safe\imagettftext',
337
+			'imagewbmp' => 'Safe\imagewbmp',
338
+			'imagewebp' => 'Safe\imagewebp',
339
+			'imagexbm' => 'Safe\imagexbm',
340
+			'imap_append' => 'Safe\imap_append',
341
+			'imap_check' => 'Safe\imap_check',
342
+			'imap_clearflag_full' => 'Safe\imap_clearflag_full',
343
+			'imap_close' => 'Safe\imap_close',
344
+			'imap_createmailbox' => 'Safe\imap_createmailbox',
345
+			'imap_deletemailbox' => 'Safe\imap_deletemailbox',
346
+			'imap_fetchstructure' => 'Safe\imap_fetchstructure',
347
+			'imap_gc' => 'Safe\imap_gc',
348
+			'imap_headerinfo' => 'Safe\imap_headerinfo',
349
+			'imap_mail' => 'Safe\imap_mail',
350
+			'imap_mailboxmsginfo' => 'Safe\imap_mailboxmsginfo',
351
+			'imap_mail_compose' => 'Safe\imap_mail_compose',
352
+			'imap_mail_copy' => 'Safe\imap_mail_copy',
353
+			'imap_mail_move' => 'Safe\imap_mail_move',
354
+			'imap_mutf7_to_utf8' => 'Safe\imap_mutf7_to_utf8',
355
+			'imap_num_msg' => 'Safe\imap_num_msg',
356
+			'imap_open' => 'Safe\imap_open',
357
+			'imap_renamemailbox' => 'Safe\imap_renamemailbox',
358
+			'imap_savebody' => 'Safe\imap_savebody',
359
+			'imap_setacl' => 'Safe\imap_setacl',
360
+			'imap_setflag_full' => 'Safe\imap_setflag_full',
361
+			'imap_set_quota' => 'Safe\imap_set_quota',
362
+			'imap_sort' => 'Safe\imap_sort',
363
+			'imap_subscribe' => 'Safe\imap_subscribe',
364
+			'imap_thread' => 'Safe\imap_thread',
365
+			'imap_timeout' => 'Safe\imap_timeout',
366
+			'imap_undelete' => 'Safe\imap_undelete',
367
+			'imap_unsubscribe' => 'Safe\imap_unsubscribe',
368
+			'imap_utf8_to_mutf7' => 'Safe\imap_utf8_to_mutf7',
369
+			'inet_ntop' => 'Safe\inet_ntop',
370
+			'inflate_add' => 'Safe\inflate_add',
371
+			'inflate_get_read_len' => 'Safe\inflate_get_read_len',
372
+			'inflate_get_status' => 'Safe\inflate_get_status',
373
+			'inflate_init' => 'Safe\inflate_init',
374
+			'ingres_autocommit' => 'Safe\ingres_autocommit',
375
+			'ingres_close' => 'Safe\ingres_close',
376
+			'ingres_commit' => 'Safe\ingres_commit',
377
+			'ingres_connect' => 'Safe\ingres_connect',
378
+			'ingres_execute' => 'Safe\ingres_execute',
379
+			'ingres_field_name' => 'Safe\ingres_field_name',
380
+			'ingres_field_type' => 'Safe\ingres_field_type',
381
+			'ingres_free_result' => 'Safe\ingres_free_result',
382
+			'ingres_pconnect' => 'Safe\ingres_pconnect',
383
+			'ingres_result_seek' => 'Safe\ingres_result_seek',
384
+			'ingres_rollback' => 'Safe\ingres_rollback',
385
+			'ingres_set_environment' => 'Safe\ingres_set_environment',
386
+			'ini_get' => 'Safe\ini_get',
387
+			'ini_set' => 'Safe\ini_set',
388
+			'inotify_init' => 'Safe\inotify_init',
389
+			'inotify_rm_watch' => 'Safe\inotify_rm_watch',
390
+			'iptcembed' => 'Safe\iptcembed',
391
+			'iptcparse' => 'Safe\iptcparse',
392
+			'jdtounix' => 'Safe\jdtounix',
393
+			'jpeg2wbmp' => 'Safe\jpeg2wbmp',
394
+			'json_decode' => 'Safe\json_decode',
395
+			'json_encode' => 'Safe\json_encode',
396
+			'json_last_error_msg' => 'Safe\json_last_error_msg',
397
+			'krsort' => 'Safe\krsort',
398
+			'ksort' => 'Safe\ksort',
399
+			'lchgrp' => 'Safe\lchgrp',
400
+			'lchown' => 'Safe\lchown',
401
+			'ldap_add' => 'Safe\ldap_add',
402
+			'ldap_add_ext' => 'Safe\ldap_add_ext',
403
+			'ldap_bind' => 'Safe\ldap_bind',
404
+			'ldap_bind_ext' => 'Safe\ldap_bind_ext',
405
+			'ldap_control_paged_result' => 'Safe\ldap_control_paged_result',
406
+			'ldap_control_paged_result_response' => 'Safe\ldap_control_paged_result_response',
407
+			'ldap_count_entries' => 'Safe\ldap_count_entries',
408
+			'ldap_delete' => 'Safe\ldap_delete',
409
+			'ldap_delete_ext' => 'Safe\ldap_delete_ext',
410
+			'ldap_exop' => 'Safe\ldap_exop',
411
+			'ldap_exop_passwd' => 'Safe\ldap_exop_passwd',
412
+			'ldap_exop_whoami' => 'Safe\ldap_exop_whoami',
413
+			'ldap_explode_dn' => 'Safe\ldap_explode_dn',
414
+			'ldap_first_attribute' => 'Safe\ldap_first_attribute',
415
+			'ldap_first_entry' => 'Safe\ldap_first_entry',
416
+			'ldap_free_result' => 'Safe\ldap_free_result',
417
+			'ldap_get_attributes' => 'Safe\ldap_get_attributes',
418
+			'ldap_get_dn' => 'Safe\ldap_get_dn',
419
+			'ldap_get_entries' => 'Safe\ldap_get_entries',
420
+			'ldap_get_option' => 'Safe\ldap_get_option',
421
+			'ldap_get_values' => 'Safe\ldap_get_values',
422
+			'ldap_get_values_len' => 'Safe\ldap_get_values_len',
423
+			'ldap_list' => 'Safe\ldap_list',
424
+			'ldap_modify_batch' => 'Safe\ldap_modify_batch',
425
+			'ldap_mod_add' => 'Safe\ldap_mod_add',
426
+			'ldap_mod_add_ext' => 'Safe\ldap_mod_add_ext',
427
+			'ldap_mod_del' => 'Safe\ldap_mod_del',
428
+			'ldap_mod_del_ext' => 'Safe\ldap_mod_del_ext',
429
+			'ldap_mod_replace' => 'Safe\ldap_mod_replace',
430
+			'ldap_mod_replace_ext' => 'Safe\ldap_mod_replace_ext',
431
+			'ldap_next_attribute' => 'Safe\ldap_next_attribute',
432
+			'ldap_parse_exop' => 'Safe\ldap_parse_exop',
433
+			'ldap_parse_result' => 'Safe\ldap_parse_result',
434
+			'ldap_read' => 'Safe\ldap_read',
435
+			'ldap_rename' => 'Safe\ldap_rename',
436
+			'ldap_rename_ext' => 'Safe\ldap_rename_ext',
437
+			'ldap_sasl_bind' => 'Safe\ldap_sasl_bind',
438
+			'ldap_search' => 'Safe\ldap_search',
439
+			'ldap_set_option' => 'Safe\ldap_set_option',
440
+			'ldap_unbind' => 'Safe\ldap_unbind',
441
+			'libxml_get_last_error' => 'Safe\libxml_get_last_error',
442
+			'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader',
443
+			'link' => 'Safe\link',
444
+			'lzf_compress' => 'Safe\lzf_compress',
445
+			'lzf_decompress' => 'Safe\lzf_decompress',
446
+			'mailparse_msg_extract_part_file' => 'Safe\mailparse_msg_extract_part_file',
447
+			'mailparse_msg_free' => 'Safe\mailparse_msg_free',
448
+			'mailparse_msg_parse' => 'Safe\mailparse_msg_parse',
449
+			'mailparse_msg_parse_file' => 'Safe\mailparse_msg_parse_file',
450
+			'mailparse_stream_encode' => 'Safe\mailparse_stream_encode',
451
+			'mb_chr' => 'Safe\mb_chr',
452
+			'mb_detect_order' => 'Safe\mb_detect_order',
453
+			'mb_encoding_aliases' => 'Safe\mb_encoding_aliases',
454
+			'mb_eregi_replace' => 'Safe\mb_eregi_replace',
455
+			'mb_ereg_replace' => 'Safe\mb_ereg_replace',
456
+			'mb_ereg_replace_callback' => 'Safe\mb_ereg_replace_callback',
457
+			'mb_ereg_search_getregs' => 'Safe\mb_ereg_search_getregs',
458
+			'mb_ereg_search_init' => 'Safe\mb_ereg_search_init',
459
+			'mb_ereg_search_regs' => 'Safe\mb_ereg_search_regs',
460
+			'mb_ereg_search_setpos' => 'Safe\mb_ereg_search_setpos',
461
+			'mb_http_output' => 'Safe\mb_http_output',
462
+			'mb_internal_encoding' => 'Safe\mb_internal_encoding',
463
+			'mb_ord' => 'Safe\mb_ord',
464
+			'mb_parse_str' => 'Safe\mb_parse_str',
465
+			'mb_regex_encoding' => 'Safe\mb_regex_encoding',
466
+			'mb_send_mail' => 'Safe\mb_send_mail',
467
+			'mb_split' => 'Safe\mb_split',
468
+			'mb_str_split' => 'Safe\mb_str_split',
469
+			'md5_file' => 'Safe\md5_file',
470
+			'metaphone' => 'Safe\metaphone',
471
+			'mime_content_type' => 'Safe\mime_content_type',
472
+			'mkdir' => 'Safe\mkdir',
473
+			'mktime' => 'Safe\mktime',
474
+			'msg_queue_exists' => 'Safe\msg_queue_exists',
475
+			'msg_receive' => 'Safe\msg_receive',
476
+			'msg_remove_queue' => 'Safe\msg_remove_queue',
477
+			'msg_send' => 'Safe\msg_send',
478
+			'msg_set_queue' => 'Safe\msg_set_queue',
479
+			'msql_affected_rows' => 'Safe\msql_affected_rows',
480
+			'msql_close' => 'Safe\msql_close',
481
+			'msql_connect' => 'Safe\msql_connect',
482
+			'msql_create_db' => 'Safe\msql_create_db',
483
+			'msql_data_seek' => 'Safe\msql_data_seek',
484
+			'msql_db_query' => 'Safe\msql_db_query',
485
+			'msql_drop_db' => 'Safe\msql_drop_db',
486
+			'msql_field_len' => 'Safe\msql_field_len',
487
+			'msql_field_name' => 'Safe\msql_field_name',
488
+			'msql_field_seek' => 'Safe\msql_field_seek',
489
+			'msql_field_table' => 'Safe\msql_field_table',
490
+			'msql_field_type' => 'Safe\msql_field_type',
491
+			'msql_free_result' => 'Safe\msql_free_result',
492
+			'msql_pconnect' => 'Safe\msql_pconnect',
493
+			'msql_query' => 'Safe\msql_query',
494
+			'msql_select_db' => 'Safe\msql_select_db',
495
+			'mysqli_get_cache_stats' => 'Safe\mysqli_get_cache_stats',
496
+			'mysqli_get_client_stats' => 'Safe\mysqli_get_client_stats',
497
+			'mysqlnd_ms_dump_servers' => 'Safe\mysqlnd_ms_dump_servers',
498
+			'mysqlnd_ms_fabric_select_global' => 'Safe\mysqlnd_ms_fabric_select_global',
499
+			'mysqlnd_ms_fabric_select_shard' => 'Safe\mysqlnd_ms_fabric_select_shard',
500
+			'mysqlnd_ms_get_last_used_connection' => 'Safe\mysqlnd_ms_get_last_used_connection',
501
+			'mysqlnd_qc_clear_cache' => 'Safe\mysqlnd_qc_clear_cache',
502
+			'mysqlnd_qc_set_is_select' => 'Safe\mysqlnd_qc_set_is_select',
503
+			'mysqlnd_qc_set_storage_handler' => 'Safe\mysqlnd_qc_set_storage_handler',
504
+			'mysql_close' => 'Safe\mysql_close',
505
+			'mysql_connect' => 'Safe\mysql_connect',
506
+			'mysql_create_db' => 'Safe\mysql_create_db',
507
+			'mysql_data_seek' => 'Safe\mysql_data_seek',
508
+			'mysql_db_name' => 'Safe\mysql_db_name',
509
+			'mysql_db_query' => 'Safe\mysql_db_query',
510
+			'mysql_drop_db' => 'Safe\mysql_drop_db',
511
+			'mysql_fetch_lengths' => 'Safe\mysql_fetch_lengths',
512
+			'mysql_field_flags' => 'Safe\mysql_field_flags',
513
+			'mysql_field_len' => 'Safe\mysql_field_len',
514
+			'mysql_field_name' => 'Safe\mysql_field_name',
515
+			'mysql_field_seek' => 'Safe\mysql_field_seek',
516
+			'mysql_free_result' => 'Safe\mysql_free_result',
517
+			'mysql_get_host_info' => 'Safe\mysql_get_host_info',
518
+			'mysql_get_proto_info' => 'Safe\mysql_get_proto_info',
519
+			'mysql_get_server_info' => 'Safe\mysql_get_server_info',
520
+			'mysql_info' => 'Safe\mysql_info',
521
+			'mysql_list_dbs' => 'Safe\mysql_list_dbs',
522
+			'mysql_list_fields' => 'Safe\mysql_list_fields',
523
+			'mysql_list_processes' => 'Safe\mysql_list_processes',
524
+			'mysql_list_tables' => 'Safe\mysql_list_tables',
525
+			'mysql_num_fields' => 'Safe\mysql_num_fields',
526
+			'mysql_num_rows' => 'Safe\mysql_num_rows',
527
+			'mysql_query' => 'Safe\mysql_query',
528
+			'mysql_real_escape_string' => 'Safe\mysql_real_escape_string',
529
+			'mysql_result' => 'Safe\mysql_result',
530
+			'mysql_select_db' => 'Safe\mysql_select_db',
531
+			'mysql_set_charset' => 'Safe\mysql_set_charset',
532
+			'mysql_tablename' => 'Safe\mysql_tablename',
533
+			'mysql_thread_id' => 'Safe\mysql_thread_id',
534
+			'mysql_unbuffered_query' => 'Safe\mysql_unbuffered_query',
535
+			'natcasesort' => 'Safe\natcasesort',
536
+			'natsort' => 'Safe\natsort',
537
+			'ob_end_clean' => 'Safe\ob_end_clean',
538
+			'ob_end_flush' => 'Safe\ob_end_flush',
539
+			'oci_bind_array_by_name' => 'Safe\oci_bind_array_by_name',
540
+			'oci_bind_by_name' => 'Safe\oci_bind_by_name',
541
+			'oci_cancel' => 'Safe\oci_cancel',
542
+			'oci_close' => 'Safe\oci_close',
543
+			'oci_commit' => 'Safe\oci_commit',
544
+			'oci_connect' => 'Safe\oci_connect',
545
+			'oci_define_by_name' => 'Safe\oci_define_by_name',
546
+			'oci_execute' => 'Safe\oci_execute',
547
+			'oci_fetch_all' => 'Safe\oci_fetch_all',
548
+			'oci_field_name' => 'Safe\oci_field_name',
549
+			'oci_field_precision' => 'Safe\oci_field_precision',
550
+			'oci_field_scale' => 'Safe\oci_field_scale',
551
+			'oci_field_size' => 'Safe\oci_field_size',
552
+			'oci_field_type' => 'Safe\oci_field_type',
553
+			'oci_field_type_raw' => 'Safe\oci_field_type_raw',
554
+			'oci_free_descriptor' => 'Safe\oci_free_descriptor',
555
+			'oci_free_statement' => 'Safe\oci_free_statement',
556
+			'oci_new_collection' => 'Safe\oci_new_collection',
557
+			'oci_new_connect' => 'Safe\oci_new_connect',
558
+			'oci_new_cursor' => 'Safe\oci_new_cursor',
559
+			'oci_new_descriptor' => 'Safe\oci_new_descriptor',
560
+			'oci_num_fields' => 'Safe\oci_num_fields',
561
+			'oci_num_rows' => 'Safe\oci_num_rows',
562
+			'oci_parse' => 'Safe\oci_parse',
563
+			'oci_pconnect' => 'Safe\oci_pconnect',
564
+			'oci_result' => 'Safe\oci_result',
565
+			'oci_rollback' => 'Safe\oci_rollback',
566
+			'oci_server_version' => 'Safe\oci_server_version',
567
+			'oci_set_action' => 'Safe\oci_set_action',
568
+			'oci_set_call_timeout' => 'Safe\oci_set_call_timeout',
569
+			'oci_set_client_identifier' => 'Safe\oci_set_client_identifier',
570
+			'oci_set_client_info' => 'Safe\oci_set_client_info',
571
+			'oci_set_db_operation' => 'Safe\oci_set_db_operation',
572
+			'oci_set_edition' => 'Safe\oci_set_edition',
573
+			'oci_set_module_name' => 'Safe\oci_set_module_name',
574
+			'oci_set_prefetch' => 'Safe\oci_set_prefetch',
575
+			'oci_statement_type' => 'Safe\oci_statement_type',
576
+			'oci_unregister_taf_callback' => 'Safe\oci_unregister_taf_callback',
577
+			'odbc_autocommit' => 'Safe\odbc_autocommit',
578
+			'odbc_binmode' => 'Safe\odbc_binmode',
579
+			'odbc_columnprivileges' => 'Safe\odbc_columnprivileges',
580
+			'odbc_columns' => 'Safe\odbc_columns',
581
+			'odbc_commit' => 'Safe\odbc_commit',
582
+			'odbc_data_source' => 'Safe\odbc_data_source',
583
+			'odbc_exec' => 'Safe\odbc_exec',
584
+			'odbc_execute' => 'Safe\odbc_execute',
585
+			'odbc_fetch_into' => 'Safe\odbc_fetch_into',
586
+			'odbc_field_len' => 'Safe\odbc_field_len',
587
+			'odbc_field_name' => 'Safe\odbc_field_name',
588
+			'odbc_field_num' => 'Safe\odbc_field_num',
589
+			'odbc_field_scale' => 'Safe\odbc_field_scale',
590
+			'odbc_field_type' => 'Safe\odbc_field_type',
591
+			'odbc_foreignkeys' => 'Safe\odbc_foreignkeys',
592
+			'odbc_gettypeinfo' => 'Safe\odbc_gettypeinfo',
593
+			'odbc_longreadlen' => 'Safe\odbc_longreadlen',
594
+			'odbc_prepare' => 'Safe\odbc_prepare',
595
+			'odbc_primarykeys' => 'Safe\odbc_primarykeys',
596
+			'odbc_result' => 'Safe\odbc_result',
597
+			'odbc_result_all' => 'Safe\odbc_result_all',
598
+			'odbc_rollback' => 'Safe\odbc_rollback',
599
+			'odbc_setoption' => 'Safe\odbc_setoption',
600
+			'odbc_specialcolumns' => 'Safe\odbc_specialcolumns',
601
+			'odbc_statistics' => 'Safe\odbc_statistics',
602
+			'odbc_tableprivileges' => 'Safe\odbc_tableprivileges',
603
+			'odbc_tables' => 'Safe\odbc_tables',
604
+			'opcache_compile_file' => 'Safe\opcache_compile_file',
605
+			'opcache_get_status' => 'Safe\opcache_get_status',
606
+			'opendir' => 'Safe\opendir',
607
+			'openlog' => 'Safe\openlog',
608
+			'openssl_cipher_iv_length' => 'Safe\openssl_cipher_iv_length',
609
+			'openssl_csr_export' => 'Safe\openssl_csr_export',
610
+			'openssl_csr_export_to_file' => 'Safe\openssl_csr_export_to_file',
611
+			'openssl_csr_get_subject' => 'Safe\openssl_csr_get_subject',
612
+			'openssl_csr_new' => 'Safe\openssl_csr_new',
613
+			'openssl_csr_sign' => 'Safe\openssl_csr_sign',
614
+			'openssl_decrypt' => 'Safe\openssl_decrypt',
615
+			'openssl_dh_compute_key' => 'Safe\openssl_dh_compute_key',
616
+			'openssl_digest' => 'Safe\openssl_digest',
617
+			'openssl_encrypt' => 'Safe\openssl_encrypt',
618
+			'openssl_open' => 'Safe\openssl_open',
619
+			'openssl_pbkdf2' => 'Safe\openssl_pbkdf2',
620
+			'openssl_pkcs7_decrypt' => 'Safe\openssl_pkcs7_decrypt',
621
+			'openssl_pkcs7_encrypt' => 'Safe\openssl_pkcs7_encrypt',
622
+			'openssl_pkcs7_read' => 'Safe\openssl_pkcs7_read',
623
+			'openssl_pkcs7_sign' => 'Safe\openssl_pkcs7_sign',
624
+			'openssl_pkcs12_export' => 'Safe\openssl_pkcs12_export',
625
+			'openssl_pkcs12_export_to_file' => 'Safe\openssl_pkcs12_export_to_file',
626
+			'openssl_pkcs12_read' => 'Safe\openssl_pkcs12_read',
627
+			'openssl_pkey_export' => 'Safe\openssl_pkey_export',
628
+			'openssl_pkey_export_to_file' => 'Safe\openssl_pkey_export_to_file',
629
+			'openssl_pkey_get_private' => 'Safe\openssl_pkey_get_private',
630
+			'openssl_pkey_get_public' => 'Safe\openssl_pkey_get_public',
631
+			'openssl_pkey_new' => 'Safe\openssl_pkey_new',
632
+			'openssl_private_decrypt' => 'Safe\openssl_private_decrypt',
633
+			'openssl_private_encrypt' => 'Safe\openssl_private_encrypt',
634
+			'openssl_public_decrypt' => 'Safe\openssl_public_decrypt',
635
+			'openssl_public_encrypt' => 'Safe\openssl_public_encrypt',
636
+			'openssl_random_pseudo_bytes' => 'Safe\openssl_random_pseudo_bytes',
637
+			'openssl_seal' => 'Safe\openssl_seal',
638
+			'openssl_sign' => 'Safe\openssl_sign',
639
+			'openssl_x509_export' => 'Safe\openssl_x509_export',
640
+			'openssl_x509_export_to_file' => 'Safe\openssl_x509_export_to_file',
641
+			'openssl_x509_fingerprint' => 'Safe\openssl_x509_fingerprint',
642
+			'openssl_x509_read' => 'Safe\openssl_x509_read',
643
+			'output_add_rewrite_var' => 'Safe\output_add_rewrite_var',
644
+			'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars',
645
+			'pack' => 'Safe\pack',
646
+			'parse_ini_file' => 'Safe\parse_ini_file',
647
+			'parse_ini_string' => 'Safe\parse_ini_string',
648
+			'parse_url' => 'Safe\parse_url',
649
+			'password_hash' => 'Safe\password_hash',
650
+			'pcntl_exec' => 'Safe\pcntl_exec',
651
+			'pcntl_getpriority' => 'Safe\pcntl_getpriority',
652
+			'pcntl_setpriority' => 'Safe\pcntl_setpriority',
653
+			'pcntl_signal_dispatch' => 'Safe\pcntl_signal_dispatch',
654
+			'pcntl_sigprocmask' => 'Safe\pcntl_sigprocmask',
655
+			'pcntl_strerror' => 'Safe\pcntl_strerror',
656
+			'PDF_activate_item' => 'Safe\PDF_activate_item',
657
+			'PDF_add_locallink' => 'Safe\PDF_add_locallink',
658
+			'PDF_add_nameddest' => 'Safe\PDF_add_nameddest',
659
+			'PDF_add_note' => 'Safe\PDF_add_note',
660
+			'PDF_add_pdflink' => 'Safe\PDF_add_pdflink',
661
+			'PDF_add_thumbnail' => 'Safe\PDF_add_thumbnail',
662
+			'PDF_add_weblink' => 'Safe\PDF_add_weblink',
663
+			'PDF_attach_file' => 'Safe\PDF_attach_file',
664
+			'PDF_begin_layer' => 'Safe\PDF_begin_layer',
665
+			'PDF_begin_page' => 'Safe\PDF_begin_page',
666
+			'PDF_begin_page_ext' => 'Safe\PDF_begin_page_ext',
667
+			'PDF_circle' => 'Safe\PDF_circle',
668
+			'PDF_clip' => 'Safe\PDF_clip',
669
+			'PDF_close' => 'Safe\PDF_close',
670
+			'PDF_closepath' => 'Safe\PDF_closepath',
671
+			'PDF_closepath_fill_stroke' => 'Safe\PDF_closepath_fill_stroke',
672
+			'PDF_closepath_stroke' => 'Safe\PDF_closepath_stroke',
673
+			'PDF_close_pdi' => 'Safe\PDF_close_pdi',
674
+			'PDF_close_pdi_page' => 'Safe\PDF_close_pdi_page',
675
+			'PDF_concat' => 'Safe\PDF_concat',
676
+			'PDF_continue_text' => 'Safe\PDF_continue_text',
677
+			'PDF_curveto' => 'Safe\PDF_curveto',
678
+			'PDF_delete' => 'Safe\PDF_delete',
679
+			'PDF_end_layer' => 'Safe\PDF_end_layer',
680
+			'PDF_end_page' => 'Safe\PDF_end_page',
681
+			'PDF_end_page_ext' => 'Safe\PDF_end_page_ext',
682
+			'PDF_end_pattern' => 'Safe\PDF_end_pattern',
683
+			'PDF_end_template' => 'Safe\PDF_end_template',
684
+			'PDF_fill' => 'Safe\PDF_fill',
685
+			'PDF_fill_stroke' => 'Safe\PDF_fill_stroke',
686
+			'PDF_fit_image' => 'Safe\PDF_fit_image',
687
+			'PDF_fit_pdi_page' => 'Safe\PDF_fit_pdi_page',
688
+			'PDF_fit_textline' => 'Safe\PDF_fit_textline',
689
+			'PDF_initgraphics' => 'Safe\PDF_initgraphics',
690
+			'PDF_lineto' => 'Safe\PDF_lineto',
691
+			'PDF_makespotcolor' => 'Safe\PDF_makespotcolor',
692
+			'PDF_moveto' => 'Safe\PDF_moveto',
693
+			'PDF_open_file' => 'Safe\PDF_open_file',
694
+			'PDF_place_image' => 'Safe\PDF_place_image',
695
+			'PDF_place_pdi_page' => 'Safe\PDF_place_pdi_page',
696
+			'PDF_rect' => 'Safe\PDF_rect',
697
+			'PDF_restore' => 'Safe\PDF_restore',
698
+			'PDF_rotate' => 'Safe\PDF_rotate',
699
+			'PDF_save' => 'Safe\PDF_save',
700
+			'PDF_scale' => 'Safe\PDF_scale',
701
+			'PDF_setcolor' => 'Safe\PDF_setcolor',
702
+			'PDF_setdash' => 'Safe\PDF_setdash',
703
+			'PDF_setdashpattern' => 'Safe\PDF_setdashpattern',
704
+			'PDF_setflat' => 'Safe\PDF_setflat',
705
+			'PDF_setfont' => 'Safe\PDF_setfont',
706
+			'PDF_setgray' => 'Safe\PDF_setgray',
707
+			'PDF_setgray_fill' => 'Safe\PDF_setgray_fill',
708
+			'PDF_setgray_stroke' => 'Safe\PDF_setgray_stroke',
709
+			'PDF_setlinejoin' => 'Safe\PDF_setlinejoin',
710
+			'PDF_setlinewidth' => 'Safe\PDF_setlinewidth',
711
+			'PDF_setmatrix' => 'Safe\PDF_setmatrix',
712
+			'PDF_setmiterlimit' => 'Safe\PDF_setmiterlimit',
713
+			'PDF_setrgbcolor' => 'Safe\PDF_setrgbcolor',
714
+			'PDF_setrgbcolor_fill' => 'Safe\PDF_setrgbcolor_fill',
715
+			'PDF_setrgbcolor_stroke' => 'Safe\PDF_setrgbcolor_stroke',
716
+			'PDF_set_border_color' => 'Safe\PDF_set_border_color',
717
+			'PDF_set_border_dash' => 'Safe\PDF_set_border_dash',
718
+			'PDF_set_border_style' => 'Safe\PDF_set_border_style',
719
+			'PDF_set_info' => 'Safe\PDF_set_info',
720
+			'PDF_set_layer_dependency' => 'Safe\PDF_set_layer_dependency',
721
+			'PDF_set_parameter' => 'Safe\PDF_set_parameter',
722
+			'PDF_set_text_pos' => 'Safe\PDF_set_text_pos',
723
+			'PDF_set_value' => 'Safe\PDF_set_value',
724
+			'PDF_show' => 'Safe\PDF_show',
725
+			'PDF_show_xy' => 'Safe\PDF_show_xy',
726
+			'PDF_skew' => 'Safe\PDF_skew',
727
+			'PDF_stroke' => 'Safe\PDF_stroke',
728
+			'pg_cancel_query' => 'Safe\pg_cancel_query',
729
+			'pg_client_encoding' => 'Safe\pg_client_encoding',
730
+			'pg_close' => 'Safe\pg_close',
731
+			'pg_connect' => 'Safe\pg_connect',
732
+			'pg_connection_reset' => 'Safe\pg_connection_reset',
733
+			'pg_convert' => 'Safe\pg_convert',
734
+			'pg_copy_from' => 'Safe\pg_copy_from',
735
+			'pg_copy_to' => 'Safe\pg_copy_to',
736
+			'pg_dbname' => 'Safe\pg_dbname',
737
+			'pg_delete' => 'Safe\pg_delete',
738
+			'pg_end_copy' => 'Safe\pg_end_copy',
739
+			'pg_execute' => 'Safe\pg_execute',
740
+			'pg_field_name' => 'Safe\pg_field_name',
741
+			'pg_field_table' => 'Safe\pg_field_table',
742
+			'pg_field_type' => 'Safe\pg_field_type',
743
+			'pg_flush' => 'Safe\pg_flush',
744
+			'pg_free_result' => 'Safe\pg_free_result',
745
+			'pg_host' => 'Safe\pg_host',
746
+			'pg_insert' => 'Safe\pg_insert',
747
+			'pg_last_error' => 'Safe\pg_last_error',
748
+			'pg_last_notice' => 'Safe\pg_last_notice',
749
+			'pg_last_oid' => 'Safe\pg_last_oid',
750
+			'pg_lo_close' => 'Safe\pg_lo_close',
751
+			'pg_lo_export' => 'Safe\pg_lo_export',
752
+			'pg_lo_import' => 'Safe\pg_lo_import',
753
+			'pg_lo_open' => 'Safe\pg_lo_open',
754
+			'pg_lo_read' => 'Safe\pg_lo_read',
755
+			'pg_lo_read_all' => 'Safe\pg_lo_read_all',
756
+			'pg_lo_seek' => 'Safe\pg_lo_seek',
757
+			'pg_lo_truncate' => 'Safe\pg_lo_truncate',
758
+			'pg_lo_unlink' => 'Safe\pg_lo_unlink',
759
+			'pg_lo_write' => 'Safe\pg_lo_write',
760
+			'pg_meta_data' => 'Safe\pg_meta_data',
761
+			'pg_options' => 'Safe\pg_options',
762
+			'pg_parameter_status' => 'Safe\pg_parameter_status',
763
+			'pg_pconnect' => 'Safe\pg_pconnect',
764
+			'pg_ping' => 'Safe\pg_ping',
765
+			'pg_port' => 'Safe\pg_port',
766
+			'pg_prepare' => 'Safe\pg_prepare',
767
+			'pg_put_line' => 'Safe\pg_put_line',
768
+			'pg_query' => 'Safe\pg_query',
769
+			'pg_query_params' => 'Safe\pg_query_params',
770
+			'pg_result_error_field' => 'Safe\pg_result_error_field',
771
+			'pg_result_seek' => 'Safe\pg_result_seek',
772
+			'pg_select' => 'Safe\pg_select',
773
+			'pg_send_execute' => 'Safe\pg_send_execute',
774
+			'pg_send_prepare' => 'Safe\pg_send_prepare',
775
+			'pg_send_query' => 'Safe\pg_send_query',
776
+			'pg_send_query_params' => 'Safe\pg_send_query_params',
777
+			'pg_socket' => 'Safe\pg_socket',
778
+			'pg_trace' => 'Safe\pg_trace',
779
+			'pg_tty' => 'Safe\pg_tty',
780
+			'pg_update' => 'Safe\pg_update',
781
+			'pg_version' => 'Safe\pg_version',
782
+			'phpcredits' => 'Safe\phpcredits',
783
+			'phpinfo' => 'Safe\phpinfo',
784
+			'png2wbmp' => 'Safe\png2wbmp',
785
+			'posix_access' => 'Safe\posix_access',
786
+			'posix_getgrnam' => 'Safe\posix_getgrnam',
787
+			'posix_getpgid' => 'Safe\posix_getpgid',
788
+			'posix_initgroups' => 'Safe\posix_initgroups',
789
+			'posix_kill' => 'Safe\posix_kill',
790
+			'posix_mkfifo' => 'Safe\posix_mkfifo',
791
+			'posix_mknod' => 'Safe\posix_mknod',
792
+			'posix_setegid' => 'Safe\posix_setegid',
793
+			'posix_seteuid' => 'Safe\posix_seteuid',
794
+			'posix_setgid' => 'Safe\posix_setgid',
795
+			'posix_setpgid' => 'Safe\posix_setpgid',
796
+			'posix_setrlimit' => 'Safe\posix_setrlimit',
797
+			'posix_setuid' => 'Safe\posix_setuid',
798
+			'preg_match' => 'Safe\preg_match',
799
+			'preg_match_all' => 'Safe\preg_match_all',
800
+			'preg_replace' => 'Safe\preg_replace',
801
+			'preg_split' => 'Safe\preg_split',
802
+			'proc_get_status' => 'Safe\proc_get_status',
803
+			'proc_nice' => 'Safe\proc_nice',
804
+			'pspell_add_to_personal' => 'Safe\pspell_add_to_personal',
805
+			'pspell_add_to_session' => 'Safe\pspell_add_to_session',
806
+			'pspell_clear_session' => 'Safe\pspell_clear_session',
807
+			'pspell_config_create' => 'Safe\pspell_config_create',
808
+			'pspell_config_data_dir' => 'Safe\pspell_config_data_dir',
809
+			'pspell_config_dict_dir' => 'Safe\pspell_config_dict_dir',
810
+			'pspell_config_ignore' => 'Safe\pspell_config_ignore',
811
+			'pspell_config_mode' => 'Safe\pspell_config_mode',
812
+			'pspell_config_personal' => 'Safe\pspell_config_personal',
813
+			'pspell_config_repl' => 'Safe\pspell_config_repl',
814
+			'pspell_config_runtogether' => 'Safe\pspell_config_runtogether',
815
+			'pspell_config_save_repl' => 'Safe\pspell_config_save_repl',
816
+			'pspell_new' => 'Safe\pspell_new',
817
+			'pspell_new_config' => 'Safe\pspell_new_config',
818
+			'pspell_save_wordlist' => 'Safe\pspell_save_wordlist',
819
+			'pspell_store_replacement' => 'Safe\pspell_store_replacement',
820
+			'ps_add_launchlink' => 'Safe\ps_add_launchlink',
821
+			'ps_add_locallink' => 'Safe\ps_add_locallink',
822
+			'ps_add_note' => 'Safe\ps_add_note',
823
+			'ps_add_pdflink' => 'Safe\ps_add_pdflink',
824
+			'ps_add_weblink' => 'Safe\ps_add_weblink',
825
+			'ps_arc' => 'Safe\ps_arc',
826
+			'ps_arcn' => 'Safe\ps_arcn',
827
+			'ps_begin_page' => 'Safe\ps_begin_page',
828
+			'ps_begin_pattern' => 'Safe\ps_begin_pattern',
829
+			'ps_begin_template' => 'Safe\ps_begin_template',
830
+			'ps_circle' => 'Safe\ps_circle',
831
+			'ps_clip' => 'Safe\ps_clip',
832
+			'ps_close' => 'Safe\ps_close',
833
+			'ps_closepath' => 'Safe\ps_closepath',
834
+			'ps_closepath_stroke' => 'Safe\ps_closepath_stroke',
835
+			'ps_close_image' => 'Safe\ps_close_image',
836
+			'ps_continue_text' => 'Safe\ps_continue_text',
837
+			'ps_curveto' => 'Safe\ps_curveto',
838
+			'ps_delete' => 'Safe\ps_delete',
839
+			'ps_end_page' => 'Safe\ps_end_page',
840
+			'ps_end_pattern' => 'Safe\ps_end_pattern',
841
+			'ps_end_template' => 'Safe\ps_end_template',
842
+			'ps_fill' => 'Safe\ps_fill',
843
+			'ps_fill_stroke' => 'Safe\ps_fill_stroke',
844
+			'ps_get_parameter' => 'Safe\ps_get_parameter',
845
+			'ps_hyphenate' => 'Safe\ps_hyphenate',
846
+			'ps_include_file' => 'Safe\ps_include_file',
847
+			'ps_lineto' => 'Safe\ps_lineto',
848
+			'ps_moveto' => 'Safe\ps_moveto',
849
+			'ps_new' => 'Safe\ps_new',
850
+			'ps_open_file' => 'Safe\ps_open_file',
851
+			'ps_place_image' => 'Safe\ps_place_image',
852
+			'ps_rect' => 'Safe\ps_rect',
853
+			'ps_restore' => 'Safe\ps_restore',
854
+			'ps_rotate' => 'Safe\ps_rotate',
855
+			'ps_save' => 'Safe\ps_save',
856
+			'ps_scale' => 'Safe\ps_scale',
857
+			'ps_setcolor' => 'Safe\ps_setcolor',
858
+			'ps_setdash' => 'Safe\ps_setdash',
859
+			'ps_setflat' => 'Safe\ps_setflat',
860
+			'ps_setfont' => 'Safe\ps_setfont',
861
+			'ps_setgray' => 'Safe\ps_setgray',
862
+			'ps_setlinecap' => 'Safe\ps_setlinecap',
863
+			'ps_setlinejoin' => 'Safe\ps_setlinejoin',
864
+			'ps_setlinewidth' => 'Safe\ps_setlinewidth',
865
+			'ps_setmiterlimit' => 'Safe\ps_setmiterlimit',
866
+			'ps_setoverprintmode' => 'Safe\ps_setoverprintmode',
867
+			'ps_setpolydash' => 'Safe\ps_setpolydash',
868
+			'ps_set_border_color' => 'Safe\ps_set_border_color',
869
+			'ps_set_border_dash' => 'Safe\ps_set_border_dash',
870
+			'ps_set_border_style' => 'Safe\ps_set_border_style',
871
+			'ps_set_info' => 'Safe\ps_set_info',
872
+			'ps_set_parameter' => 'Safe\ps_set_parameter',
873
+			'ps_set_text_pos' => 'Safe\ps_set_text_pos',
874
+			'ps_set_value' => 'Safe\ps_set_value',
875
+			'ps_shading' => 'Safe\ps_shading',
876
+			'ps_shading_pattern' => 'Safe\ps_shading_pattern',
877
+			'ps_shfill' => 'Safe\ps_shfill',
878
+			'ps_show' => 'Safe\ps_show',
879
+			'ps_show2' => 'Safe\ps_show2',
880
+			'ps_show_xy' => 'Safe\ps_show_xy',
881
+			'ps_show_xy2' => 'Safe\ps_show_xy2',
882
+			'ps_stroke' => 'Safe\ps_stroke',
883
+			'ps_symbol' => 'Safe\ps_symbol',
884
+			'ps_translate' => 'Safe\ps_translate',
885
+			'putenv' => 'Safe\putenv',
886
+			'readfile' => 'Safe\readfile',
887
+			'readgzfile' => 'Safe\readgzfile',
888
+			'readline_add_history' => 'Safe\readline_add_history',
889
+			'readline_callback_handler_install' => 'Safe\readline_callback_handler_install',
890
+			'readline_clear_history' => 'Safe\readline_clear_history',
891
+			'readline_completion_function' => 'Safe\readline_completion_function',
892
+			'readline_read_history' => 'Safe\readline_read_history',
893
+			'readline_write_history' => 'Safe\readline_write_history',
894
+			'readlink' => 'Safe\readlink',
895
+			'realpath' => 'Safe\realpath',
896
+			'register_tick_function' => 'Safe\register_tick_function',
897
+			'rename' => 'Safe\rename',
898
+			'rewind' => 'Safe\rewind',
899
+			'rewinddir' => 'Safe\rewinddir',
900
+			'rmdir' => 'Safe\rmdir',
901
+			'rpmaddtag' => 'Safe\rpmaddtag',
902
+			'rrd_create' => 'Safe\rrd_create',
903
+			'rsort' => 'Safe\rsort',
904
+			'sapi_windows_cp_conv' => 'Safe\sapi_windows_cp_conv',
905
+			'sapi_windows_cp_set' => 'Safe\sapi_windows_cp_set',
906
+			'sapi_windows_generate_ctrl_event' => 'Safe\sapi_windows_generate_ctrl_event',
907
+			'sapi_windows_vt100_support' => 'Safe\sapi_windows_vt100_support',
908
+			'scandir' => 'Safe\scandir',
909
+			'sem_acquire' => 'Safe\sem_acquire',
910
+			'sem_get' => 'Safe\sem_get',
911
+			'sem_release' => 'Safe\sem_release',
912
+			'sem_remove' => 'Safe\sem_remove',
913
+			'session_abort' => 'Safe\session_abort',
914
+			'session_decode' => 'Safe\session_decode',
915
+			'session_destroy' => 'Safe\session_destroy',
916
+			'session_regenerate_id' => 'Safe\session_regenerate_id',
917
+			'session_reset' => 'Safe\session_reset',
918
+			'session_unset' => 'Safe\session_unset',
919
+			'session_write_close' => 'Safe\session_write_close',
920
+			'settype' => 'Safe\settype',
921
+			'set_include_path' => 'Safe\set_include_path',
922
+			'set_time_limit' => 'Safe\set_time_limit',
923
+			'sha1_file' => 'Safe\sha1_file',
924
+			'shmop_delete' => 'Safe\shmop_delete',
925
+			'shmop_read' => 'Safe\shmop_read',
926
+			'shmop_write' => 'Safe\shmop_write',
927
+			'shm_put_var' => 'Safe\shm_put_var',
928
+			'shm_remove' => 'Safe\shm_remove',
929
+			'shm_remove_var' => 'Safe\shm_remove_var',
930
+			'shuffle' => 'Safe\shuffle',
931
+			'simplexml_import_dom' => 'Safe\simplexml_import_dom',
932
+			'simplexml_load_file' => 'Safe\simplexml_load_file',
933
+			'simplexml_load_string' => 'Safe\simplexml_load_string',
934
+			'sleep' => 'Safe\sleep',
935
+			'socket_accept' => 'Safe\socket_accept',
936
+			'socket_addrinfo_bind' => 'Safe\socket_addrinfo_bind',
937
+			'socket_addrinfo_connect' => 'Safe\socket_addrinfo_connect',
938
+			'socket_bind' => 'Safe\socket_bind',
939
+			'socket_connect' => 'Safe\socket_connect',
940
+			'socket_create' => 'Safe\socket_create',
941
+			'socket_create_listen' => 'Safe\socket_create_listen',
942
+			'socket_create_pair' => 'Safe\socket_create_pair',
943
+			'socket_export_stream' => 'Safe\socket_export_stream',
944
+			'socket_getpeername' => 'Safe\socket_getpeername',
945
+			'socket_getsockname' => 'Safe\socket_getsockname',
946
+			'socket_get_option' => 'Safe\socket_get_option',
947
+			'socket_import_stream' => 'Safe\socket_import_stream',
948
+			'socket_listen' => 'Safe\socket_listen',
949
+			'socket_read' => 'Safe\socket_read',
950
+			'socket_send' => 'Safe\socket_send',
951
+			'socket_sendmsg' => 'Safe\socket_sendmsg',
952
+			'socket_sendto' => 'Safe\socket_sendto',
953
+			'socket_set_block' => 'Safe\socket_set_block',
954
+			'socket_set_nonblock' => 'Safe\socket_set_nonblock',
955
+			'socket_set_option' => 'Safe\socket_set_option',
956
+			'socket_shutdown' => 'Safe\socket_shutdown',
957
+			'socket_write' => 'Safe\socket_write',
958
+			'socket_wsaprotocol_info_export' => 'Safe\socket_wsaprotocol_info_export',
959
+			'socket_wsaprotocol_info_import' => 'Safe\socket_wsaprotocol_info_import',
960
+			'socket_wsaprotocol_info_release' => 'Safe\socket_wsaprotocol_info_release',
961
+			'sodium_crypto_pwhash' => 'Safe\sodium_crypto_pwhash',
962
+			'sodium_crypto_pwhash_str' => 'Safe\sodium_crypto_pwhash_str',
963
+			'solr_get_version' => 'Safe\solr_get_version',
964
+			'sort' => 'Safe\sort',
965
+			'soundex' => 'Safe\soundex',
966
+			'spl_autoload_register' => 'Safe\spl_autoload_register',
967
+			'spl_autoload_unregister' => 'Safe\spl_autoload_unregister',
968
+			'sprintf' => 'Safe\sprintf',
969
+			'sqlsrv_begin_transaction' => 'Safe\sqlsrv_begin_transaction',
970
+			'sqlsrv_cancel' => 'Safe\sqlsrv_cancel',
971
+			'sqlsrv_client_info' => 'Safe\sqlsrv_client_info',
972
+			'sqlsrv_close' => 'Safe\sqlsrv_close',
973
+			'sqlsrv_commit' => 'Safe\sqlsrv_commit',
974
+			'sqlsrv_configure' => 'Safe\sqlsrv_configure',
975
+			'sqlsrv_execute' => 'Safe\sqlsrv_execute',
976
+			'sqlsrv_free_stmt' => 'Safe\sqlsrv_free_stmt',
977
+			'sqlsrv_get_field' => 'Safe\sqlsrv_get_field',
978
+			'sqlsrv_next_result' => 'Safe\sqlsrv_next_result',
979
+			'sqlsrv_num_fields' => 'Safe\sqlsrv_num_fields',
980
+			'sqlsrv_num_rows' => 'Safe\sqlsrv_num_rows',
981
+			'sqlsrv_prepare' => 'Safe\sqlsrv_prepare',
982
+			'sqlsrv_query' => 'Safe\sqlsrv_query',
983
+			'sqlsrv_rollback' => 'Safe\sqlsrv_rollback',
984
+			'ssdeep_fuzzy_compare' => 'Safe\ssdeep_fuzzy_compare',
985
+			'ssdeep_fuzzy_hash' => 'Safe\ssdeep_fuzzy_hash',
986
+			'ssdeep_fuzzy_hash_filename' => 'Safe\ssdeep_fuzzy_hash_filename',
987
+			'ssh2_auth_agent' => 'Safe\ssh2_auth_agent',
988
+			'ssh2_auth_hostbased_file' => 'Safe\ssh2_auth_hostbased_file',
989
+			'ssh2_auth_password' => 'Safe\ssh2_auth_password',
990
+			'ssh2_auth_pubkey_file' => 'Safe\ssh2_auth_pubkey_file',
991
+			'ssh2_connect' => 'Safe\ssh2_connect',
992
+			'ssh2_disconnect' => 'Safe\ssh2_disconnect',
993
+			'ssh2_exec' => 'Safe\ssh2_exec',
994
+			'ssh2_publickey_add' => 'Safe\ssh2_publickey_add',
995
+			'ssh2_publickey_init' => 'Safe\ssh2_publickey_init',
996
+			'ssh2_publickey_remove' => 'Safe\ssh2_publickey_remove',
997
+			'ssh2_scp_recv' => 'Safe\ssh2_scp_recv',
998
+			'ssh2_scp_send' => 'Safe\ssh2_scp_send',
999
+			'ssh2_sftp' => 'Safe\ssh2_sftp',
1000
+			'ssh2_sftp_chmod' => 'Safe\ssh2_sftp_chmod',
1001
+			'ssh2_sftp_mkdir' => 'Safe\ssh2_sftp_mkdir',
1002
+			'ssh2_sftp_rename' => 'Safe\ssh2_sftp_rename',
1003
+			'ssh2_sftp_rmdir' => 'Safe\ssh2_sftp_rmdir',
1004
+			'ssh2_sftp_symlink' => 'Safe\ssh2_sftp_symlink',
1005
+			'ssh2_sftp_unlink' => 'Safe\ssh2_sftp_unlink',
1006
+			'stream_context_set_params' => 'Safe\stream_context_set_params',
1007
+			'stream_copy_to_stream' => 'Safe\stream_copy_to_stream',
1008
+			'stream_filter_append' => 'Safe\stream_filter_append',
1009
+			'stream_filter_prepend' => 'Safe\stream_filter_prepend',
1010
+			'stream_filter_register' => 'Safe\stream_filter_register',
1011
+			'stream_filter_remove' => 'Safe\stream_filter_remove',
1012
+			'stream_get_contents' => 'Safe\stream_get_contents',
1013
+			'stream_isatty' => 'Safe\stream_isatty',
1014
+			'stream_resolve_include_path' => 'Safe\stream_resolve_include_path',
1015
+			'stream_set_blocking' => 'Safe\stream_set_blocking',
1016
+			'stream_set_timeout' => 'Safe\stream_set_timeout',
1017
+			'stream_socket_accept' => 'Safe\stream_socket_accept',
1018
+			'stream_socket_client' => 'Safe\stream_socket_client',
1019
+			'stream_socket_pair' => 'Safe\stream_socket_pair',
1020
+			'stream_socket_server' => 'Safe\stream_socket_server',
1021
+			'stream_socket_shutdown' => 'Safe\stream_socket_shutdown',
1022
+			'stream_supports_lock' => 'Safe\stream_supports_lock',
1023
+			'stream_wrapper_register' => 'Safe\stream_wrapper_register',
1024
+			'stream_wrapper_restore' => 'Safe\stream_wrapper_restore',
1025
+			'stream_wrapper_unregister' => 'Safe\stream_wrapper_unregister',
1026
+			'strptime' => 'Safe\strptime',
1027
+			'strtotime' => 'Safe\strtotime',
1028
+			'substr' => 'Safe\substr',
1029
+			'swoole_async_write' => 'Safe\swoole_async_write',
1030
+			'swoole_async_writefile' => 'Safe\swoole_async_writefile',
1031
+			'swoole_event_defer' => 'Safe\swoole_event_defer',
1032
+			'swoole_event_del' => 'Safe\swoole_event_del',
1033
+			'swoole_event_write' => 'Safe\swoole_event_write',
1034
+			'symlink' => 'Safe\symlink',
1035
+			'syslog' => 'Safe\syslog',
1036
+			'system' => 'Safe\system',
1037
+			'tempnam' => 'Safe\tempnam',
1038
+			'timezone_name_from_abbr' => 'Safe\timezone_name_from_abbr',
1039
+			'time_nanosleep' => 'Safe\time_nanosleep',
1040
+			'time_sleep_until' => 'Safe\time_sleep_until',
1041
+			'tmpfile' => 'Safe\tmpfile',
1042
+			'touch' => 'Safe\touch',
1043
+			'uasort' => 'Safe\uasort',
1044
+			'uksort' => 'Safe\uksort',
1045
+			'unlink' => 'Safe\unlink',
1046
+			'unpack' => 'Safe\unpack',
1047
+			'uopz_extend' => 'Safe\uopz_extend',
1048
+			'uopz_implement' => 'Safe\uopz_implement',
1049
+			'usort' => 'Safe\usort',
1050
+			'virtual' => 'Safe\virtual',
1051
+			'vsprintf' => 'Safe\vsprintf',
1052
+			'xdiff_file_bdiff' => 'Safe\xdiff_file_bdiff',
1053
+			'xdiff_file_bpatch' => 'Safe\xdiff_file_bpatch',
1054
+			'xdiff_file_diff' => 'Safe\xdiff_file_diff',
1055
+			'xdiff_file_diff_binary' => 'Safe\xdiff_file_diff_binary',
1056
+			'xdiff_file_patch_binary' => 'Safe\xdiff_file_patch_binary',
1057
+			'xdiff_file_rabdiff' => 'Safe\xdiff_file_rabdiff',
1058
+			'xdiff_string_bpatch' => 'Safe\xdiff_string_bpatch',
1059
+			'xdiff_string_patch' => 'Safe\xdiff_string_patch',
1060
+			'xdiff_string_patch_binary' => 'Safe\xdiff_string_patch_binary',
1061
+			'xmlrpc_set_type' => 'Safe\xmlrpc_set_type',
1062
+			'xml_parser_create' => 'Safe\xml_parser_create',
1063
+			'xml_parser_create_ns' => 'Safe\xml_parser_create_ns',
1064
+			'xml_set_object' => 'Safe\xml_set_object',
1065
+			'yaml_parse' => 'Safe\yaml_parse',
1066
+			'yaml_parse_file' => 'Safe\yaml_parse_file',
1067
+			'yaml_parse_url' => 'Safe\yaml_parse_url',
1068
+			'yaz_ccl_parse' => 'Safe\yaz_ccl_parse',
1069
+			'yaz_close' => 'Safe\yaz_close',
1070
+			'yaz_connect' => 'Safe\yaz_connect',
1071
+			'yaz_database' => 'Safe\yaz_database',
1072
+			'yaz_element' => 'Safe\yaz_element',
1073
+			'yaz_present' => 'Safe\yaz_present',
1074
+			'yaz_search' => 'Safe\yaz_search',
1075
+			'yaz_wait' => 'Safe\yaz_wait',
1076
+			'zip_entry_close' => 'Safe\zip_entry_close',
1077
+			'zip_entry_open' => 'Safe\zip_entry_open',
1078
+			'zip_entry_read' => 'Safe\zip_entry_read',
1079
+			'zlib_decode' => 'Safe\zlib_decode',
1080 1080
 ]]]);
1081 1081
 };
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@
 block discarded – undo
6 6
 use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
7 7
 
8 8
 # This file configures rector/rector:~0.7.0 to replace all PHP functions with their equivalent "safe" functions
9
-return static function (ContainerConfigurator $containerConfigurator): void {
9
+return static function(ContainerConfigurator $containerConfigurator): void {
10 10
     $services = $containerConfigurator->services();
11 11
 
12 12
     $services->set(RenameFunctionRector::class)
13
-        ->call('configure', [[ RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [
13
+        ->call('configure', [[RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [
14 14
             'apache_getenv' => 'Safe\apache_getenv',
15 15
             'apache_get_version' => 'Safe\apache_get_version',
16 16
             'apache_request_headers' => 'Safe\apache_request_headers',
Please login to merge, or discard this patch.
vendor-bin/php-scoper/vendor/nikic/php-parser/lib/PhpParser/Builder.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 interface Builder
6 6
 {
7
-    /**
8
-     * Returns the built node.
9
-     *
10
-     * @return Node The built node
11
-     */
12
-    public function getNode() : Node;
7
+	/**
8
+	 * Returns the built node.
9
+	 *
10
+	 * @return Node The built node
11
+	 */
12
+	public function getNode() : Node;
13 13
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace PhpParser;
4 4
 
5
-interface Builder
6
-{
5
+interface Builder {
7 6
     /**
8 7
      * Returns the built node.
9 8
      *
Please login to merge, or discard this patch.
php-scoper/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php 3 patches
Indentation   +979 added lines, -979 removed lines patch added patch discarded remove patch
@@ -29,413 +29,413 @@  discard block
 block discarded – undo
29 29
 
30 30
 abstract class ParserAbstract implements Parser
31 31
 {
32
-    const SYMBOL_NONE = -1;
32
+	const SYMBOL_NONE = -1;
33 33
 
34
-    /*
34
+	/*
35 35
      * The following members will be filled with generated parsing data:
36 36
      */
37 37
 
38
-    /** @var int Size of $tokenToSymbol map */
39
-    protected $tokenToSymbolMapSize;
40
-    /** @var int Size of $action table */
41
-    protected $actionTableSize;
42
-    /** @var int Size of $goto table */
43
-    protected $gotoTableSize;
44
-
45
-    /** @var int Symbol number signifying an invalid token */
46
-    protected $invalidSymbol;
47
-    /** @var int Symbol number of error recovery token */
48
-    protected $errorSymbol;
49
-    /** @var int Action number signifying default action */
50
-    protected $defaultAction;
51
-    /** @var int Rule number signifying that an unexpected token was encountered */
52
-    protected $unexpectedTokenRule;
53
-
54
-    protected $YY2TBLSTATE;
55
-    /** @var int Number of non-leaf states */
56
-    protected $numNonLeafStates;
57
-
58
-    /** @var int[] Map of lexer tokens to internal symbols */
59
-    protected $tokenToSymbol;
60
-    /** @var string[] Map of symbols to their names */
61
-    protected $symbolToName;
62
-    /** @var array Names of the production rules (only necessary for debugging) */
63
-    protected $productions;
64
-
65
-    /** @var int[] Map of states to a displacement into the $action table. The corresponding action for this
66
-     *             state/symbol pair is $action[$actionBase[$state] + $symbol]. If $actionBase[$state] is 0, the
67
-     *             action is defaulted, i.e. $actionDefault[$state] should be used instead. */
68
-    protected $actionBase;
69
-    /** @var int[] Table of actions. Indexed according to $actionBase comment. */
70
-    protected $action;
71
-    /** @var int[] Table indexed analogously to $action. If $actionCheck[$actionBase[$state] + $symbol] != $symbol
72
-     *             then the action is defaulted, i.e. $actionDefault[$state] should be used instead. */
73
-    protected $actionCheck;
74
-    /** @var int[] Map of states to their default action */
75
-    protected $actionDefault;
76
-    /** @var callable[] Semantic action callbacks */
77
-    protected $reduceCallbacks;
78
-
79
-    /** @var int[] Map of non-terminals to a displacement into the $goto table. The corresponding goto state for this
80
-     *             non-terminal/state pair is $goto[$gotoBase[$nonTerminal] + $state] (unless defaulted) */
81
-    protected $gotoBase;
82
-    /** @var int[] Table of states to goto after reduction. Indexed according to $gotoBase comment. */
83
-    protected $goto;
84
-    /** @var int[] Table indexed analogously to $goto. If $gotoCheck[$gotoBase[$nonTerminal] + $state] != $nonTerminal
85
-     *             then the goto state is defaulted, i.e. $gotoDefault[$nonTerminal] should be used. */
86
-    protected $gotoCheck;
87
-    /** @var int[] Map of non-terminals to the default state to goto after their reduction */
88
-    protected $gotoDefault;
89
-
90
-    /** @var int[] Map of rules to the non-terminal on their left-hand side, i.e. the non-terminal to use for
91
-     *             determining the state to goto after reduction. */
92
-    protected $ruleToNonTerminal;
93
-    /** @var int[] Map of rules to the length of their right-hand side, which is the number of elements that have to
94
-     *             be popped from the stack(s) on reduction. */
95
-    protected $ruleToLength;
96
-
97
-    /*
38
+	/** @var int Size of $tokenToSymbol map */
39
+	protected $tokenToSymbolMapSize;
40
+	/** @var int Size of $action table */
41
+	protected $actionTableSize;
42
+	/** @var int Size of $goto table */
43
+	protected $gotoTableSize;
44
+
45
+	/** @var int Symbol number signifying an invalid token */
46
+	protected $invalidSymbol;
47
+	/** @var int Symbol number of error recovery token */
48
+	protected $errorSymbol;
49
+	/** @var int Action number signifying default action */
50
+	protected $defaultAction;
51
+	/** @var int Rule number signifying that an unexpected token was encountered */
52
+	protected $unexpectedTokenRule;
53
+
54
+	protected $YY2TBLSTATE;
55
+	/** @var int Number of non-leaf states */
56
+	protected $numNonLeafStates;
57
+
58
+	/** @var int[] Map of lexer tokens to internal symbols */
59
+	protected $tokenToSymbol;
60
+	/** @var string[] Map of symbols to their names */
61
+	protected $symbolToName;
62
+	/** @var array Names of the production rules (only necessary for debugging) */
63
+	protected $productions;
64
+
65
+	/** @var int[] Map of states to a displacement into the $action table. The corresponding action for this
66
+	 *             state/symbol pair is $action[$actionBase[$state] + $symbol]. If $actionBase[$state] is 0, the
67
+	 *             action is defaulted, i.e. $actionDefault[$state] should be used instead. */
68
+	protected $actionBase;
69
+	/** @var int[] Table of actions. Indexed according to $actionBase comment. */
70
+	protected $action;
71
+	/** @var int[] Table indexed analogously to $action. If $actionCheck[$actionBase[$state] + $symbol] != $symbol
72
+	 *             then the action is defaulted, i.e. $actionDefault[$state] should be used instead. */
73
+	protected $actionCheck;
74
+	/** @var int[] Map of states to their default action */
75
+	protected $actionDefault;
76
+	/** @var callable[] Semantic action callbacks */
77
+	protected $reduceCallbacks;
78
+
79
+	/** @var int[] Map of non-terminals to a displacement into the $goto table. The corresponding goto state for this
80
+	 *             non-terminal/state pair is $goto[$gotoBase[$nonTerminal] + $state] (unless defaulted) */
81
+	protected $gotoBase;
82
+	/** @var int[] Table of states to goto after reduction. Indexed according to $gotoBase comment. */
83
+	protected $goto;
84
+	/** @var int[] Table indexed analogously to $goto. If $gotoCheck[$gotoBase[$nonTerminal] + $state] != $nonTerminal
85
+	 *             then the goto state is defaulted, i.e. $gotoDefault[$nonTerminal] should be used. */
86
+	protected $gotoCheck;
87
+	/** @var int[] Map of non-terminals to the default state to goto after their reduction */
88
+	protected $gotoDefault;
89
+
90
+	/** @var int[] Map of rules to the non-terminal on their left-hand side, i.e. the non-terminal to use for
91
+	 *             determining the state to goto after reduction. */
92
+	protected $ruleToNonTerminal;
93
+	/** @var int[] Map of rules to the length of their right-hand side, which is the number of elements that have to
94
+	 *             be popped from the stack(s) on reduction. */
95
+	protected $ruleToLength;
96
+
97
+	/*
98 98
      * The following members are part of the parser state:
99 99
      */
100 100
 
101
-    /** @var Lexer Lexer that is used when parsing */
102
-    protected $lexer;
103
-    /** @var mixed Temporary value containing the result of last semantic action (reduction) */
104
-    protected $semValue;
105
-    /** @var array Semantic value stack (contains values of tokens and semantic action results) */
106
-    protected $semStack;
107
-    /** @var array[] Start attribute stack */
108
-    protected $startAttributeStack;
109
-    /** @var array[] End attribute stack */
110
-    protected $endAttributeStack;
111
-    /** @var array End attributes of last *shifted* token */
112
-    protected $endAttributes;
113
-    /** @var array Start attributes of last *read* token */
114
-    protected $lookaheadStartAttributes;
115
-
116
-    /** @var ErrorHandler Error handler */
117
-    protected $errorHandler;
118
-    /** @var int Error state, used to avoid error floods */
119
-    protected $errorState;
120
-
121
-    /**
122
-     * Initialize $reduceCallbacks map.
123
-     */
124
-    abstract protected function initReduceCallbacks();
125
-
126
-    /**
127
-     * Creates a parser instance.
128
-     *
129
-     * Options: Currently none.
130
-     *
131
-     * @param Lexer $lexer A lexer
132
-     * @param array $options Options array.
133
-     */
134
-    public function __construct(Lexer $lexer, array $options = []) {
135
-        $this->lexer = $lexer;
136
-
137
-        if (isset($options['throwOnError'])) {
138
-            throw new \LogicException(
139
-                '"throwOnError" is no longer supported, use "errorHandler" instead');
140
-        }
141
-
142
-        $this->initReduceCallbacks();
143
-    }
144
-
145
-    /**
146
-     * Parses PHP code into a node tree.
147
-     *
148
-     * If a non-throwing error handler is used, the parser will continue parsing after an error
149
-     * occurred and attempt to build a partial AST.
150
-     *
151
-     * @param string $code The source code to parse
152
-     * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults
153
-     *                                        to ErrorHandler\Throwing.
154
-     *
155
-     * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and
156
-     *                          the parser was unable to recover from an error).
157
-     */
158
-    public function parse(string $code, ?ErrorHandler $errorHandler = null) {
159
-        $this->errorHandler = $errorHandler ?: new ErrorHandler\Throwing;
160
-
161
-        $this->lexer->startLexing($code, $this->errorHandler);
162
-        $result = $this->doParse();
163
-
164
-        // Clear out some of the interior state, so we don't hold onto unnecessary
165
-        // memory between uses of the parser
166
-        $this->startAttributeStack = [];
167
-        $this->endAttributeStack = [];
168
-        $this->semStack = [];
169
-        $this->semValue = null;
170
-
171
-        return $result;
172
-    }
173
-
174
-    protected function doParse() {
175
-        // We start off with no lookahead-token
176
-        $symbol = self::SYMBOL_NONE;
177
-
178
-        // The attributes for a node are taken from the first and last token of the node.
179
-        // From the first token only the startAttributes are taken and from the last only
180
-        // the endAttributes. Both are merged using the array union operator (+).
181
-        $startAttributes = [];
182
-        $endAttributes = [];
183
-        $this->endAttributes = $endAttributes;
184
-
185
-        // Keep stack of start and end attributes
186
-        $this->startAttributeStack = [];
187
-        $this->endAttributeStack = [$endAttributes];
188
-
189
-        // Start off in the initial state and keep a stack of previous states
190
-        $state = 0;
191
-        $stateStack = [$state];
192
-
193
-        // Semantic value stack (contains values of tokens and semantic action results)
194
-        $this->semStack = [];
195
-
196
-        // Current position in the stack(s)
197
-        $stackPos = 0;
198
-
199
-        $this->errorState = 0;
200
-
201
-        for (;;) {
202
-            //$this->traceNewState($state, $symbol);
203
-
204
-            if ($this->actionBase[$state] === 0) {
205
-                $rule = $this->actionDefault[$state];
206
-            } else {
207
-                if ($symbol === self::SYMBOL_NONE) {
208
-                    // Fetch the next token id from the lexer and fetch additional info by-ref.
209
-                    // The end attributes are fetched into a temporary variable and only set once the token is really
210
-                    // shifted (not during read). Otherwise you would sometimes get off-by-one errors, when a rule is
211
-                    // reduced after a token was read but not yet shifted.
212
-                    $tokenId = $this->lexer->getNextToken($tokenValue, $startAttributes, $endAttributes);
213
-
214
-                    // map the lexer token id to the internally used symbols
215
-                    $symbol = $tokenId >= 0 && $tokenId < $this->tokenToSymbolMapSize
216
-                        ? $this->tokenToSymbol[$tokenId]
217
-                        : $this->invalidSymbol;
218
-
219
-                    if ($symbol === $this->invalidSymbol) {
220
-                        throw new \RangeException(sprintf(
221
-                            'The lexer returned an invalid token (id=%d, value=%s)',
222
-                            $tokenId, $tokenValue
223
-                        ));
224
-                    }
225
-
226
-                    // Allow productions to access the start attributes of the lookahead token.
227
-                    $this->lookaheadStartAttributes = $startAttributes;
228
-
229
-                    //$this->traceRead($symbol);
230
-                }
231
-
232
-                $idx = $this->actionBase[$state] + $symbol;
233
-                if ((($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol)
234
-                     || ($state < $this->YY2TBLSTATE
235
-                         && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0
236
-                         && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol))
237
-                    && ($action = $this->action[$idx]) !== $this->defaultAction) {
238
-                    /*
101
+	/** @var Lexer Lexer that is used when parsing */
102
+	protected $lexer;
103
+	/** @var mixed Temporary value containing the result of last semantic action (reduction) */
104
+	protected $semValue;
105
+	/** @var array Semantic value stack (contains values of tokens and semantic action results) */
106
+	protected $semStack;
107
+	/** @var array[] Start attribute stack */
108
+	protected $startAttributeStack;
109
+	/** @var array[] End attribute stack */
110
+	protected $endAttributeStack;
111
+	/** @var array End attributes of last *shifted* token */
112
+	protected $endAttributes;
113
+	/** @var array Start attributes of last *read* token */
114
+	protected $lookaheadStartAttributes;
115
+
116
+	/** @var ErrorHandler Error handler */
117
+	protected $errorHandler;
118
+	/** @var int Error state, used to avoid error floods */
119
+	protected $errorState;
120
+
121
+	/**
122
+	 * Initialize $reduceCallbacks map.
123
+	 */
124
+	abstract protected function initReduceCallbacks();
125
+
126
+	/**
127
+	 * Creates a parser instance.
128
+	 *
129
+	 * Options: Currently none.
130
+	 *
131
+	 * @param Lexer $lexer A lexer
132
+	 * @param array $options Options array.
133
+	 */
134
+	public function __construct(Lexer $lexer, array $options = []) {
135
+		$this->lexer = $lexer;
136
+
137
+		if (isset($options['throwOnError'])) {
138
+			throw new \LogicException(
139
+				'"throwOnError" is no longer supported, use "errorHandler" instead');
140
+		}
141
+
142
+		$this->initReduceCallbacks();
143
+	}
144
+
145
+	/**
146
+	 * Parses PHP code into a node tree.
147
+	 *
148
+	 * If a non-throwing error handler is used, the parser will continue parsing after an error
149
+	 * occurred and attempt to build a partial AST.
150
+	 *
151
+	 * @param string $code The source code to parse
152
+	 * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults
153
+	 *                                        to ErrorHandler\Throwing.
154
+	 *
155
+	 * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and
156
+	 *                          the parser was unable to recover from an error).
157
+	 */
158
+	public function parse(string $code, ?ErrorHandler $errorHandler = null) {
159
+		$this->errorHandler = $errorHandler ?: new ErrorHandler\Throwing;
160
+
161
+		$this->lexer->startLexing($code, $this->errorHandler);
162
+		$result = $this->doParse();
163
+
164
+		// Clear out some of the interior state, so we don't hold onto unnecessary
165
+		// memory between uses of the parser
166
+		$this->startAttributeStack = [];
167
+		$this->endAttributeStack = [];
168
+		$this->semStack = [];
169
+		$this->semValue = null;
170
+
171
+		return $result;
172
+	}
173
+
174
+	protected function doParse() {
175
+		// We start off with no lookahead-token
176
+		$symbol = self::SYMBOL_NONE;
177
+
178
+		// The attributes for a node are taken from the first and last token of the node.
179
+		// From the first token only the startAttributes are taken and from the last only
180
+		// the endAttributes. Both are merged using the array union operator (+).
181
+		$startAttributes = [];
182
+		$endAttributes = [];
183
+		$this->endAttributes = $endAttributes;
184
+
185
+		// Keep stack of start and end attributes
186
+		$this->startAttributeStack = [];
187
+		$this->endAttributeStack = [$endAttributes];
188
+
189
+		// Start off in the initial state and keep a stack of previous states
190
+		$state = 0;
191
+		$stateStack = [$state];
192
+
193
+		// Semantic value stack (contains values of tokens and semantic action results)
194
+		$this->semStack = [];
195
+
196
+		// Current position in the stack(s)
197
+		$stackPos = 0;
198
+
199
+		$this->errorState = 0;
200
+
201
+		for (;;) {
202
+			//$this->traceNewState($state, $symbol);
203
+
204
+			if ($this->actionBase[$state] === 0) {
205
+				$rule = $this->actionDefault[$state];
206
+			} else {
207
+				if ($symbol === self::SYMBOL_NONE) {
208
+					// Fetch the next token id from the lexer and fetch additional info by-ref.
209
+					// The end attributes are fetched into a temporary variable and only set once the token is really
210
+					// shifted (not during read). Otherwise you would sometimes get off-by-one errors, when a rule is
211
+					// reduced after a token was read but not yet shifted.
212
+					$tokenId = $this->lexer->getNextToken($tokenValue, $startAttributes, $endAttributes);
213
+
214
+					// map the lexer token id to the internally used symbols
215
+					$symbol = $tokenId >= 0 && $tokenId < $this->tokenToSymbolMapSize
216
+						? $this->tokenToSymbol[$tokenId]
217
+						: $this->invalidSymbol;
218
+
219
+					if ($symbol === $this->invalidSymbol) {
220
+						throw new \RangeException(sprintf(
221
+							'The lexer returned an invalid token (id=%d, value=%s)',
222
+							$tokenId, $tokenValue
223
+						));
224
+					}
225
+
226
+					// Allow productions to access the start attributes of the lookahead token.
227
+					$this->lookaheadStartAttributes = $startAttributes;
228
+
229
+					//$this->traceRead($symbol);
230
+				}
231
+
232
+				$idx = $this->actionBase[$state] + $symbol;
233
+				if ((($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol)
234
+					 || ($state < $this->YY2TBLSTATE
235
+						 && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0
236
+						 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol))
237
+					&& ($action = $this->action[$idx]) !== $this->defaultAction) {
238
+					/*
239 239
                      * >= numNonLeafStates: shift and reduce
240 240
                      * > 0: shift
241 241
                      * = 0: accept
242 242
                      * < 0: reduce
243 243
                      * = -YYUNEXPECTED: error
244 244
                      */
245
-                    if ($action > 0) {
246
-                        /* shift */
247
-                        //$this->traceShift($symbol);
248
-
249
-                        ++$stackPos;
250
-                        $stateStack[$stackPos] = $state = $action;
251
-                        $this->semStack[$stackPos] = $tokenValue;
252
-                        $this->startAttributeStack[$stackPos] = $startAttributes;
253
-                        $this->endAttributeStack[$stackPos] = $endAttributes;
254
-                        $this->endAttributes = $endAttributes;
255
-                        $symbol = self::SYMBOL_NONE;
256
-
257
-                        if ($this->errorState) {
258
-                            --$this->errorState;
259
-                        }
260
-
261
-                        if ($action < $this->numNonLeafStates) {
262
-                            continue;
263
-                        }
264
-
265
-                        /* $yyn >= numNonLeafStates means shift-and-reduce */
266
-                        $rule = $action - $this->numNonLeafStates;
267
-                    } else {
268
-                        $rule = -$action;
269
-                    }
270
-                } else {
271
-                    $rule = $this->actionDefault[$state];
272
-                }
273
-            }
274
-
275
-            for (;;) {
276
-                if ($rule === 0) {
277
-                    /* accept */
278
-                    //$this->traceAccept();
279
-                    return $this->semValue;
280
-                } elseif ($rule !== $this->unexpectedTokenRule) {
281
-                    /* reduce */
282
-                    //$this->traceReduce($rule);
283
-
284
-                    try {
285
-                        $this->reduceCallbacks[$rule]($stackPos);
286
-                    } catch (Error $e) {
287
-                        if (-1 === $e->getStartLine() && isset($startAttributes['startLine'])) {
288
-                            $e->setStartLine($startAttributes['startLine']);
289
-                        }
290
-
291
-                        $this->emitError($e);
292
-                        // Can't recover from this type of error
293
-                        return null;
294
-                    }
295
-
296
-                    /* Goto - shift nonterminal */
297
-                    $lastEndAttributes = $this->endAttributeStack[$stackPos];
298
-                    $ruleLength = $this->ruleToLength[$rule];
299
-                    $stackPos -= $ruleLength;
300
-                    $nonTerminal = $this->ruleToNonTerminal[$rule];
301
-                    $idx = $this->gotoBase[$nonTerminal] + $stateStack[$stackPos];
302
-                    if ($idx >= 0 && $idx < $this->gotoTableSize && $this->gotoCheck[$idx] === $nonTerminal) {
303
-                        $state = $this->goto[$idx];
304
-                    } else {
305
-                        $state = $this->gotoDefault[$nonTerminal];
306
-                    }
307
-
308
-                    ++$stackPos;
309
-                    $stateStack[$stackPos]     = $state;
310
-                    $this->semStack[$stackPos] = $this->semValue;
311
-                    $this->endAttributeStack[$stackPos] = $lastEndAttributes;
312
-                    if ($ruleLength === 0) {
313
-                        // Empty productions use the start attributes of the lookahead token.
314
-                        $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes;
315
-                    }
316
-                } else {
317
-                    /* error */
318
-                    switch ($this->errorState) {
319
-                        case 0:
320
-                            $msg = $this->getErrorMessage($symbol, $state);
321
-                            $this->emitError(new Error($msg, $startAttributes + $endAttributes));
322
-                            // Break missing intentionally
323
-                        case 1:
324
-                        case 2:
325
-                            $this->errorState = 3;
326
-
327
-                            // Pop until error-expecting state uncovered
328
-                            while (!(
329
-                                (($idx = $this->actionBase[$state] + $this->errorSymbol) >= 0
330
-                                    && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol)
331
-                                || ($state < $this->YY2TBLSTATE
332
-                                    && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $this->errorSymbol) >= 0
333
-                                    && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol)
334
-                            ) || ($action = $this->action[$idx]) === $this->defaultAction) { // Not totally sure about this
335
-                                if ($stackPos <= 0) {
336
-                                    // Could not recover from error
337
-                                    return null;
338
-                                }
339
-                                $state = $stateStack[--$stackPos];
340
-                                //$this->tracePop($state);
341
-                            }
342
-
343
-                            //$this->traceShift($this->errorSymbol);
344
-                            ++$stackPos;
345
-                            $stateStack[$stackPos] = $state = $action;
346
-
347
-                            // We treat the error symbol as being empty, so we reset the end attributes
348
-                            // to the end attributes of the last non-error symbol
349
-                            $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes;
350
-                            $this->endAttributeStack[$stackPos] = $this->endAttributeStack[$stackPos - 1];
351
-                            $this->endAttributes = $this->endAttributeStack[$stackPos - 1];
352
-                            break;
353
-
354
-                        case 3:
355
-                            if ($symbol === 0) {
356
-                                // Reached EOF without recovering from error
357
-                                return null;
358
-                            }
359
-
360
-                            //$this->traceDiscard($symbol);
361
-                            $symbol = self::SYMBOL_NONE;
362
-                            break 2;
363
-                    }
364
-                }
365
-
366
-                if ($state < $this->numNonLeafStates) {
367
-                    break;
368
-                }
369
-
370
-                /* >= numNonLeafStates means shift-and-reduce */
371
-                $rule = $state - $this->numNonLeafStates;
372
-            }
373
-        }
374
-
375
-        throw new \RuntimeException('Reached end of parser loop');
376
-    }
377
-
378
-    protected function emitError(Error $error) {
379
-        $this->errorHandler->handleError($error);
380
-    }
381
-
382
-    /**
383
-     * Format error message including expected tokens.
384
-     *
385
-     * @param int $symbol Unexpected symbol
386
-     * @param int $state  State at time of error
387
-     *
388
-     * @return string Formatted error message
389
-     */
390
-    protected function getErrorMessage(int $symbol, int $state) : string {
391
-        $expectedString = '';
392
-        if ($expected = $this->getExpectedTokens($state)) {
393
-            $expectedString = ', expecting ' . implode(' or ', $expected);
394
-        }
395
-
396
-        return 'Syntax error, unexpected ' . $this->symbolToName[$symbol] . $expectedString;
397
-    }
398
-
399
-    /**
400
-     * Get limited number of expected tokens in given state.
401
-     *
402
-     * @param int $state State
403
-     *
404
-     * @return string[] Expected tokens. If too many, an empty array is returned.
405
-     */
406
-    protected function getExpectedTokens(int $state) : array {
407
-        $expected = [];
408
-
409
-        $base = $this->actionBase[$state];
410
-        foreach ($this->symbolToName as $symbol => $name) {
411
-            $idx = $base + $symbol;
412
-            if ($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol
413
-                || $state < $this->YY2TBLSTATE
414
-                && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0
415
-                && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol
416
-            ) {
417
-                if ($this->action[$idx] !== $this->unexpectedTokenRule
418
-                    && $this->action[$idx] !== $this->defaultAction
419
-                    && $symbol !== $this->errorSymbol
420
-                ) {
421
-                    if (count($expected) === 4) {
422
-                        /* Too many expected tokens */
423
-                        return [];
424
-                    }
425
-
426
-                    $expected[] = $name;
427
-                }
428
-            }
429
-        }
430
-
431
-        return $expected;
432
-    }
433
-
434
-    /*
245
+					if ($action > 0) {
246
+						/* shift */
247
+						//$this->traceShift($symbol);
248
+
249
+						++$stackPos;
250
+						$stateStack[$stackPos] = $state = $action;
251
+						$this->semStack[$stackPos] = $tokenValue;
252
+						$this->startAttributeStack[$stackPos] = $startAttributes;
253
+						$this->endAttributeStack[$stackPos] = $endAttributes;
254
+						$this->endAttributes = $endAttributes;
255
+						$symbol = self::SYMBOL_NONE;
256
+
257
+						if ($this->errorState) {
258
+							--$this->errorState;
259
+						}
260
+
261
+						if ($action < $this->numNonLeafStates) {
262
+							continue;
263
+						}
264
+
265
+						/* $yyn >= numNonLeafStates means shift-and-reduce */
266
+						$rule = $action - $this->numNonLeafStates;
267
+					} else {
268
+						$rule = -$action;
269
+					}
270
+				} else {
271
+					$rule = $this->actionDefault[$state];
272
+				}
273
+			}
274
+
275
+			for (;;) {
276
+				if ($rule === 0) {
277
+					/* accept */
278
+					//$this->traceAccept();
279
+					return $this->semValue;
280
+				} elseif ($rule !== $this->unexpectedTokenRule) {
281
+					/* reduce */
282
+					//$this->traceReduce($rule);
283
+
284
+					try {
285
+						$this->reduceCallbacks[$rule]($stackPos);
286
+					} catch (Error $e) {
287
+						if (-1 === $e->getStartLine() && isset($startAttributes['startLine'])) {
288
+							$e->setStartLine($startAttributes['startLine']);
289
+						}
290
+
291
+						$this->emitError($e);
292
+						// Can't recover from this type of error
293
+						return null;
294
+					}
295
+
296
+					/* Goto - shift nonterminal */
297
+					$lastEndAttributes = $this->endAttributeStack[$stackPos];
298
+					$ruleLength = $this->ruleToLength[$rule];
299
+					$stackPos -= $ruleLength;
300
+					$nonTerminal = $this->ruleToNonTerminal[$rule];
301
+					$idx = $this->gotoBase[$nonTerminal] + $stateStack[$stackPos];
302
+					if ($idx >= 0 && $idx < $this->gotoTableSize && $this->gotoCheck[$idx] === $nonTerminal) {
303
+						$state = $this->goto[$idx];
304
+					} else {
305
+						$state = $this->gotoDefault[$nonTerminal];
306
+					}
307
+
308
+					++$stackPos;
309
+					$stateStack[$stackPos]     = $state;
310
+					$this->semStack[$stackPos] = $this->semValue;
311
+					$this->endAttributeStack[$stackPos] = $lastEndAttributes;
312
+					if ($ruleLength === 0) {
313
+						// Empty productions use the start attributes of the lookahead token.
314
+						$this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes;
315
+					}
316
+				} else {
317
+					/* error */
318
+					switch ($this->errorState) {
319
+						case 0:
320
+							$msg = $this->getErrorMessage($symbol, $state);
321
+							$this->emitError(new Error($msg, $startAttributes + $endAttributes));
322
+							// Break missing intentionally
323
+						case 1:
324
+						case 2:
325
+							$this->errorState = 3;
326
+
327
+							// Pop until error-expecting state uncovered
328
+							while (!(
329
+								(($idx = $this->actionBase[$state] + $this->errorSymbol) >= 0
330
+									&& $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol)
331
+								|| ($state < $this->YY2TBLSTATE
332
+									&& ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $this->errorSymbol) >= 0
333
+									&& $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol)
334
+							) || ($action = $this->action[$idx]) === $this->defaultAction) { // Not totally sure about this
335
+								if ($stackPos <= 0) {
336
+									// Could not recover from error
337
+									return null;
338
+								}
339
+								$state = $stateStack[--$stackPos];
340
+								//$this->tracePop($state);
341
+							}
342
+
343
+							//$this->traceShift($this->errorSymbol);
344
+							++$stackPos;
345
+							$stateStack[$stackPos] = $state = $action;
346
+
347
+							// We treat the error symbol as being empty, so we reset the end attributes
348
+							// to the end attributes of the last non-error symbol
349
+							$this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes;
350
+							$this->endAttributeStack[$stackPos] = $this->endAttributeStack[$stackPos - 1];
351
+							$this->endAttributes = $this->endAttributeStack[$stackPos - 1];
352
+							break;
353
+
354
+						case 3:
355
+							if ($symbol === 0) {
356
+								// Reached EOF without recovering from error
357
+								return null;
358
+							}
359
+
360
+							//$this->traceDiscard($symbol);
361
+							$symbol = self::SYMBOL_NONE;
362
+							break 2;
363
+					}
364
+				}
365
+
366
+				if ($state < $this->numNonLeafStates) {
367
+					break;
368
+				}
369
+
370
+				/* >= numNonLeafStates means shift-and-reduce */
371
+				$rule = $state - $this->numNonLeafStates;
372
+			}
373
+		}
374
+
375
+		throw new \RuntimeException('Reached end of parser loop');
376
+	}
377
+
378
+	protected function emitError(Error $error) {
379
+		$this->errorHandler->handleError($error);
380
+	}
381
+
382
+	/**
383
+	 * Format error message including expected tokens.
384
+	 *
385
+	 * @param int $symbol Unexpected symbol
386
+	 * @param int $state  State at time of error
387
+	 *
388
+	 * @return string Formatted error message
389
+	 */
390
+	protected function getErrorMessage(int $symbol, int $state) : string {
391
+		$expectedString = '';
392
+		if ($expected = $this->getExpectedTokens($state)) {
393
+			$expectedString = ', expecting ' . implode(' or ', $expected);
394
+		}
395
+
396
+		return 'Syntax error, unexpected ' . $this->symbolToName[$symbol] . $expectedString;
397
+	}
398
+
399
+	/**
400
+	 * Get limited number of expected tokens in given state.
401
+	 *
402
+	 * @param int $state State
403
+	 *
404
+	 * @return string[] Expected tokens. If too many, an empty array is returned.
405
+	 */
406
+	protected function getExpectedTokens(int $state) : array {
407
+		$expected = [];
408
+
409
+		$base = $this->actionBase[$state];
410
+		foreach ($this->symbolToName as $symbol => $name) {
411
+			$idx = $base + $symbol;
412
+			if ($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol
413
+				|| $state < $this->YY2TBLSTATE
414
+				&& ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0
415
+				&& $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol
416
+			) {
417
+				if ($this->action[$idx] !== $this->unexpectedTokenRule
418
+					&& $this->action[$idx] !== $this->defaultAction
419
+					&& $symbol !== $this->errorSymbol
420
+				) {
421
+					if (count($expected) === 4) {
422
+						/* Too many expected tokens */
423
+						return [];
424
+					}
425
+
426
+					$expected[] = $name;
427
+				}
428
+			}
429
+		}
430
+
431
+		return $expected;
432
+	}
433
+
434
+	/*
435 435
      * Tracing functions used for debugging the parser.
436 436
      */
437 437
 
438
-    /*
438
+	/*
439 439
     protected function traceNewState($state, $symbol) {
440 440
         echo '% State ' . $state
441 441
             . ', Lookahead ' . ($symbol == self::SYMBOL_NONE ? '--none--' : $this->symbolToName[$symbol]) . "\n";
@@ -466,595 +466,595 @@  discard block
 block discarded – undo
466 466
     }
467 467
     */
468 468
 
469
-    /*
469
+	/*
470 470
      * Helper functions invoked by semantic actions
471 471
      */
472 472
 
473
-    /**
474
-     * Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions.
475
-     *
476
-     * @param Node\Stmt[] $stmts
477
-     * @return Node\Stmt[]
478
-     */
479
-    protected function handleNamespaces(array $stmts) : array {
480
-        $hasErrored = false;
481
-        $style = $this->getNamespacingStyle($stmts);
482
-        if (null === $style) {
483
-            // not namespaced, nothing to do
484
-            return $stmts;
485
-        } elseif ('brace' === $style) {
486
-            // For braced namespaces we only have to check that there are no invalid statements between the namespaces
487
-            $afterFirstNamespace = false;
488
-            foreach ($stmts as $stmt) {
489
-                if ($stmt instanceof Node\Stmt\Namespace_) {
490
-                    $afterFirstNamespace = true;
491
-                } elseif (!$stmt instanceof Node\Stmt\HaltCompiler
492
-                        && !$stmt instanceof Node\Stmt\Nop
493
-                        && $afterFirstNamespace && !$hasErrored) {
494
-                    $this->emitError(new Error(
495
-                        'No code may exist outside of namespace {}', $stmt->getAttributes()));
496
-                    $hasErrored = true; // Avoid one error for every statement
497
-                }
498
-            }
499
-            return $stmts;
500
-        } else {
501
-            // For semicolon namespaces we have to move the statements after a namespace declaration into ->stmts
502
-            $resultStmts = [];
503
-            $targetStmts =& $resultStmts;
504
-            $lastNs = null;
505
-            foreach ($stmts as $stmt) {
506
-                if ($stmt instanceof Node\Stmt\Namespace_) {
507
-                    if ($lastNs !== null) {
508
-                        $this->fixupNamespaceAttributes($lastNs);
509
-                    }
510
-                    if ($stmt->stmts === null) {
511
-                        $stmt->stmts = [];
512
-                        $targetStmts =& $stmt->stmts;
513
-                        $resultStmts[] = $stmt;
514
-                    } else {
515
-                        // This handles the invalid case of mixed style namespaces
516
-                        $resultStmts[] = $stmt;
517
-                        $targetStmts =& $resultStmts;
518
-                    }
519
-                    $lastNs = $stmt;
520
-                } elseif ($stmt instanceof Node\Stmt\HaltCompiler) {
521
-                    // __halt_compiler() is not moved into the namespace
522
-                    $resultStmts[] = $stmt;
523
-                } else {
524
-                    $targetStmts[] = $stmt;
525
-                }
526
-            }
527
-            if ($lastNs !== null) {
528
-                $this->fixupNamespaceAttributes($lastNs);
529
-            }
530
-            return $resultStmts;
531
-        }
532
-    }
533
-
534
-    private function fixupNamespaceAttributes(Node\Stmt\Namespace_ $stmt) {
535
-        // We moved the statements into the namespace node, as such the end of the namespace node
536
-        // needs to be extended to the end of the statements.
537
-        if (empty($stmt->stmts)) {
538
-            return;
539
-        }
540
-
541
-        // We only move the builtin end attributes here. This is the best we can do with the
542
-        // knowledge we have.
543
-        $endAttributes = ['endLine', 'endFilePos', 'endTokenPos'];
544
-        $lastStmt = $stmt->stmts[count($stmt->stmts) - 1];
545
-        foreach ($endAttributes as $endAttribute) {
546
-            if ($lastStmt->hasAttribute($endAttribute)) {
547
-                $stmt->setAttribute($endAttribute, $lastStmt->getAttribute($endAttribute));
548
-            }
549
-        }
550
-    }
551
-
552
-    /**
553
-     * Determine namespacing style (semicolon or brace)
554
-     *
555
-     * @param Node[] $stmts Top-level statements.
556
-     *
557
-     * @return null|string One of "semicolon", "brace" or null (no namespaces)
558
-     */
559
-    private function getNamespacingStyle(array $stmts) {
560
-        $style = null;
561
-        $hasNotAllowedStmts = false;
562
-        foreach ($stmts as $i => $stmt) {
563
-            if ($stmt instanceof Node\Stmt\Namespace_) {
564
-                $currentStyle = null === $stmt->stmts ? 'semicolon' : 'brace';
565
-                if (null === $style) {
566
-                    $style = $currentStyle;
567
-                    if ($hasNotAllowedStmts) {
568
-                        $this->emitError(new Error(
569
-                            'Namespace declaration statement has to be the very first statement in the script',
570
-                            $stmt->getLine() // Avoid marking the entire namespace as an error
571
-                        ));
572
-                    }
573
-                } elseif ($style !== $currentStyle) {
574
-                    $this->emitError(new Error(
575
-                        'Cannot mix bracketed namespace declarations with unbracketed namespace declarations',
576
-                        $stmt->getLine() // Avoid marking the entire namespace as an error
577
-                    ));
578
-                    // Treat like semicolon style for namespace normalization
579
-                    return 'semicolon';
580
-                }
581
-                continue;
582
-            }
583
-
584
-            /* declare(), __halt_compiler() and nops can be used before a namespace declaration */
585
-            if ($stmt instanceof Node\Stmt\Declare_
586
-                || $stmt instanceof Node\Stmt\HaltCompiler
587
-                || $stmt instanceof Node\Stmt\Nop) {
588
-                continue;
589
-            }
590
-
591
-            /* There may be a hashbang line at the very start of the file */
592
-            if ($i === 0 && $stmt instanceof Node\Stmt\InlineHTML && preg_match('/\A#!.*\r?\n\z/', $stmt->value)) {
593
-                continue;
594
-            }
595
-
596
-            /* Everything else if forbidden before namespace declarations */
597
-            $hasNotAllowedStmts = true;
598
-        }
599
-        return $style;
600
-    }
601
-
602
-    /**
603
-     * Fix up parsing of static property calls in PHP 5.
604
-     *
605
-     * In PHP 5 A::$b[c][d] and A::$b[c][d]() have very different interpretation. The former is
606
-     * interpreted as (A::$b)[c][d], while the latter is the same as A::{$b[c][d]}(). We parse the
607
-     * latter as the former initially and this method fixes the AST into the correct form when we
608
-     * encounter the "()".
609
-     *
610
-     * @param  Node\Expr\StaticPropertyFetch|Node\Expr\ArrayDimFetch $prop
611
-     * @param  Node\Arg[] $args
612
-     * @param  array      $attributes
613
-     *
614
-     * @return Expr\StaticCall
615
-     */
616
-    protected function fixupPhp5StaticPropCall($prop, array $args, array $attributes) : Expr\StaticCall {
617
-        if ($prop instanceof Node\Expr\StaticPropertyFetch) {
618
-            $name = $prop->name instanceof VarLikeIdentifier
619
-                ? $prop->name->toString() : $prop->name;
620
-            $var = new Expr\Variable($name, $prop->name->getAttributes());
621
-            return new Expr\StaticCall($prop->class, $var, $args, $attributes);
622
-        } elseif ($prop instanceof Node\Expr\ArrayDimFetch) {
623
-            $tmp = $prop;
624
-            while ($tmp->var instanceof Node\Expr\ArrayDimFetch) {
625
-                $tmp = $tmp->var;
626
-            }
627
-
628
-            /** @var Expr\StaticPropertyFetch $staticProp */
629
-            $staticProp = $tmp->var;
630
-
631
-            // Set start attributes to attributes of innermost node
632
-            $tmp = $prop;
633
-            $this->fixupStartAttributes($tmp, $staticProp->name);
634
-            while ($tmp->var instanceof Node\Expr\ArrayDimFetch) {
635
-                $tmp = $tmp->var;
636
-                $this->fixupStartAttributes($tmp, $staticProp->name);
637
-            }
638
-
639
-            $name = $staticProp->name instanceof VarLikeIdentifier
640
-                ? $staticProp->name->toString() : $staticProp->name;
641
-            $tmp->var = new Expr\Variable($name, $staticProp->name->getAttributes());
642
-            return new Expr\StaticCall($staticProp->class, $prop, $args, $attributes);
643
-        } else {
644
-            throw new \Exception;
645
-        }
646
-    }
647
-
648
-    protected function fixupStartAttributes(Node $to, Node $from) {
649
-        $startAttributes = ['startLine', 'startFilePos', 'startTokenPos'];
650
-        foreach ($startAttributes as $startAttribute) {
651
-            if ($from->hasAttribute($startAttribute)) {
652
-                $to->setAttribute($startAttribute, $from->getAttribute($startAttribute));
653
-            }
654
-        }
655
-    }
656
-
657
-    protected function handleBuiltinTypes(Name $name) {
658
-        $builtinTypes = [
659
-            'bool'     => true,
660
-            'int'      => true,
661
-            'float'    => true,
662
-            'string'   => true,
663
-            'iterable' => true,
664
-            'void'     => true,
665
-            'object'   => true,
666
-            'null'     => true,
667
-            'false'    => true,
668
-            'mixed'    => true,
669
-            'never'    => true,
670
-            'true'     => true,
671
-        ];
672
-
673
-        if (!$name->isUnqualified()) {
674
-            return $name;
675
-        }
676
-
677
-        $lowerName = $name->toLowerString();
678
-        if (!isset($builtinTypes[$lowerName])) {
679
-            return $name;
680
-        }
681
-
682
-        return new Node\Identifier($lowerName, $name->getAttributes());
683
-    }
684
-
685
-    /**
686
-     * Get combined start and end attributes at a stack location
687
-     *
688
-     * @param int $pos Stack location
689
-     *
690
-     * @return array Combined start and end attributes
691
-     */
692
-    protected function getAttributesAt(int $pos) : array {
693
-        return $this->startAttributeStack[$pos] + $this->endAttributeStack[$pos];
694
-    }
695
-
696
-    protected function getFloatCastKind(string $cast): int
697
-    {
698
-        $cast = strtolower($cast);
699
-        if (strpos($cast, 'float') !== false) {
700
-            return Double::KIND_FLOAT;
701
-        }
702
-
703
-        if (strpos($cast, 'real') !== false) {
704
-            return Double::KIND_REAL;
705
-        }
706
-
707
-        return Double::KIND_DOUBLE;
708
-    }
709
-
710
-    protected function parseLNumber($str, $attributes, $allowInvalidOctal = false) {
711
-        try {
712
-            return LNumber::fromString($str, $attributes, $allowInvalidOctal);
713
-        } catch (Error $error) {
714
-            $this->emitError($error);
715
-            // Use dummy value
716
-            return new LNumber(0, $attributes);
717
-        }
718
-    }
719
-
720
-    /**
721
-     * Parse a T_NUM_STRING token into either an integer or string node.
722
-     *
723
-     * @param string $str        Number string
724
-     * @param array  $attributes Attributes
725
-     *
726
-     * @return LNumber|String_ Integer or string node.
727
-     */
728
-    protected function parseNumString(string $str, array $attributes) {
729
-        if (!preg_match('/^(?:0|-?[1-9][0-9]*)$/', $str)) {
730
-            return new String_($str, $attributes);
731
-        }
732
-
733
-        $num = +$str;
734
-        if (!is_int($num)) {
735
-            return new String_($str, $attributes);
736
-        }
737
-
738
-        return new LNumber($num, $attributes);
739
-    }
740
-
741
-    protected function stripIndentation(
742
-        string $string, int $indentLen, string $indentChar,
743
-        bool $newlineAtStart, bool $newlineAtEnd, array $attributes
744
-    ) {
745
-        if ($indentLen === 0) {
746
-            return $string;
747
-        }
748
-
749
-        $start = $newlineAtStart ? '(?:(?<=\n)|\A)' : '(?<=\n)';
750
-        $end = $newlineAtEnd ? '(?:(?=[\r\n])|\z)' : '(?=[\r\n])';
751
-        $regex = '/' . $start . '([ \t]*)(' . $end . ')?/';
752
-        return preg_replace_callback(
753
-            $regex,
754
-            function ($matches) use ($indentLen, $indentChar, $attributes) {
755
-                $prefix = substr($matches[1], 0, $indentLen);
756
-                if (false !== strpos($prefix, $indentChar === " " ? "\t" : " ")) {
757
-                    $this->emitError(new Error(
758
-                        'Invalid indentation - tabs and spaces cannot be mixed', $attributes
759
-                    ));
760
-                } elseif (strlen($prefix) < $indentLen && !isset($matches[2])) {
761
-                    $this->emitError(new Error(
762
-                        'Invalid body indentation level ' .
763
-                        '(expecting an indentation level of at least ' . $indentLen . ')',
764
-                        $attributes
765
-                    ));
766
-                }
767
-                return substr($matches[0], strlen($prefix));
768
-            },
769
-            $string
770
-        );
771
-    }
772
-
773
-    protected function parseDocString(
774
-        string $startToken, $contents, string $endToken,
775
-        array $attributes, array $endTokenAttributes, bool $parseUnicodeEscape
776
-    ) {
777
-        $kind = strpos($startToken, "'") === false
778
-            ? String_::KIND_HEREDOC : String_::KIND_NOWDOC;
779
-
780
-        $regex = '/\A[bB]?<<<[ \t]*[\'"]?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[\'"]?(?:\r\n|\n|\r)\z/';
781
-        $result = preg_match($regex, $startToken, $matches);
782
-        assert($result === 1);
783
-        $label = $matches[1];
784
-
785
-        $result = preg_match('/\A[ \t]*/', $endToken, $matches);
786
-        assert($result === 1);
787
-        $indentation = $matches[0];
788
-
789
-        $attributes['kind'] = $kind;
790
-        $attributes['docLabel'] = $label;
791
-        $attributes['docIndentation'] = $indentation;
792
-
793
-        $indentHasSpaces = false !== strpos($indentation, " ");
794
-        $indentHasTabs = false !== strpos($indentation, "\t");
795
-        if ($indentHasSpaces && $indentHasTabs) {
796
-            $this->emitError(new Error(
797
-                'Invalid indentation - tabs and spaces cannot be mixed',
798
-                $endTokenAttributes
799
-            ));
800
-
801
-            // Proceed processing as if this doc string is not indented
802
-            $indentation = '';
803
-        }
804
-
805
-        $indentLen = \strlen($indentation);
806
-        $indentChar = $indentHasSpaces ? " " : "\t";
807
-
808
-        if (\is_string($contents)) {
809
-            if ($contents === '') {
810
-                return new String_('', $attributes);
811
-            }
812
-
813
-            $contents = $this->stripIndentation(
814
-                $contents, $indentLen, $indentChar, true, true, $attributes
815
-            );
816
-            $contents = preg_replace('~(\r\n|\n|\r)\z~', '', $contents);
817
-
818
-            if ($kind === String_::KIND_HEREDOC) {
819
-                $contents = String_::parseEscapeSequences($contents, null, $parseUnicodeEscape);
820
-            }
821
-
822
-            return new String_($contents, $attributes);
823
-        } else {
824
-            assert(count($contents) > 0);
825
-            if (!$contents[0] instanceof Node\Scalar\EncapsedStringPart) {
826
-                // If there is no leading encapsed string part, pretend there is an empty one
827
-                $this->stripIndentation(
828
-                    '', $indentLen, $indentChar, true, false, $contents[0]->getAttributes()
829
-                );
830
-            }
831
-
832
-            $newContents = [];
833
-            foreach ($contents as $i => $part) {
834
-                if ($part instanceof Node\Scalar\EncapsedStringPart) {
835
-                    $isLast = $i === \count($contents) - 1;
836
-                    $part->value = $this->stripIndentation(
837
-                        $part->value, $indentLen, $indentChar,
838
-                        $i === 0, $isLast, $part->getAttributes()
839
-                    );
840
-                    $part->value = String_::parseEscapeSequences($part->value, null, $parseUnicodeEscape);
841
-                    if ($isLast) {
842
-                        $part->value = preg_replace('~(\r\n|\n|\r)\z~', '', $part->value);
843
-                    }
844
-                    if ('' === $part->value) {
845
-                        continue;
846
-                    }
847
-                }
848
-                $newContents[] = $part;
849
-            }
850
-            return new Encapsed($newContents, $attributes);
851
-        }
852
-    }
853
-
854
-    /**
855
-     * Create attributes for a zero-length common-capturing nop.
856
-     *
857
-     * @param Comment[] $comments
858
-     * @return array
859
-     */
860
-    protected function createCommentNopAttributes(array $comments) {
861
-        $comment = $comments[count($comments) - 1];
862
-        $commentEndLine = $comment->getEndLine();
863
-        $commentEndFilePos = $comment->getEndFilePos();
864
-        $commentEndTokenPos = $comment->getEndTokenPos();
865
-
866
-        $attributes = ['comments' => $comments];
867
-        if (-1 !== $commentEndLine) {
868
-            $attributes['startLine'] = $commentEndLine;
869
-            $attributes['endLine'] = $commentEndLine;
870
-        }
871
-        if (-1 !== $commentEndFilePos) {
872
-            $attributes['startFilePos'] = $commentEndFilePos + 1;
873
-            $attributes['endFilePos'] = $commentEndFilePos;
874
-        }
875
-        if (-1 !== $commentEndTokenPos) {
876
-            $attributes['startTokenPos'] = $commentEndTokenPos + 1;
877
-            $attributes['endTokenPos'] = $commentEndTokenPos;
878
-        }
879
-        return $attributes;
880
-    }
881
-
882
-    /** @param ElseIf_|Else_ $node */
883
-    protected function fixupAlternativeElse($node) {
884
-        // Make sure a trailing nop statement carrying comments is part of the node.
885
-        $numStmts = \count($node->stmts);
886
-        if ($numStmts !== 0 && $node->stmts[$numStmts - 1] instanceof Nop) {
887
-            $nopAttrs = $node->stmts[$numStmts - 1]->getAttributes();
888
-            if (isset($nopAttrs['endLine'])) {
889
-                $node->setAttribute('endLine', $nopAttrs['endLine']);
890
-            }
891
-            if (isset($nopAttrs['endFilePos'])) {
892
-                $node->setAttribute('endFilePos', $nopAttrs['endFilePos']);
893
-            }
894
-            if (isset($nopAttrs['endTokenPos'])) {
895
-                $node->setAttribute('endTokenPos', $nopAttrs['endTokenPos']);
896
-            }
897
-        }
898
-    }
899
-
900
-    protected function checkClassModifier($a, $b, $modifierPos) {
901
-        try {
902
-            Class_::verifyClassModifier($a, $b);
903
-        } catch (Error $error) {
904
-            $error->setAttributes($this->getAttributesAt($modifierPos));
905
-            $this->emitError($error);
906
-        }
907
-    }
908
-
909
-    protected function checkModifier($a, $b, $modifierPos) {
910
-        // Jumping through some hoops here because verifyModifier() is also used elsewhere
911
-        try {
912
-            Class_::verifyModifier($a, $b);
913
-        } catch (Error $error) {
914
-            $error->setAttributes($this->getAttributesAt($modifierPos));
915
-            $this->emitError($error);
916
-        }
917
-    }
918
-
919
-    protected function checkParam(Param $node) {
920
-        if ($node->variadic && null !== $node->default) {
921
-            $this->emitError(new Error(
922
-                'Variadic parameter cannot have a default value',
923
-                $node->default->getAttributes()
924
-            ));
925
-        }
926
-    }
927
-
928
-    protected function checkTryCatch(TryCatch $node) {
929
-        if (empty($node->catches) && null === $node->finally) {
930
-            $this->emitError(new Error(
931
-                'Cannot use try without catch or finally', $node->getAttributes()
932
-            ));
933
-        }
934
-    }
935
-
936
-    protected function checkNamespace(Namespace_ $node) {
937
-        if (null !== $node->stmts) {
938
-            foreach ($node->stmts as $stmt) {
939
-                if ($stmt instanceof Namespace_) {
940
-                    $this->emitError(new Error(
941
-                        'Namespace declarations cannot be nested', $stmt->getAttributes()
942
-                    ));
943
-                }
944
-            }
945
-        }
946
-    }
947
-
948
-    private function checkClassName($name, $namePos) {
949
-        if (null !== $name && $name->isSpecialClassName()) {
950
-            $this->emitError(new Error(
951
-                sprintf('Cannot use \'%s\' as class name as it is reserved', $name),
952
-                $this->getAttributesAt($namePos)
953
-            ));
954
-        }
955
-    }
956
-
957
-    private function checkImplementedInterfaces(array $interfaces) {
958
-        foreach ($interfaces as $interface) {
959
-            if ($interface->isSpecialClassName()) {
960
-                $this->emitError(new Error(
961
-                    sprintf('Cannot use \'%s\' as interface name as it is reserved', $interface),
962
-                    $interface->getAttributes()
963
-                ));
964
-            }
965
-        }
966
-    }
967
-
968
-    protected function checkClass(Class_ $node, $namePos) {
969
-        $this->checkClassName($node->name, $namePos);
970
-
971
-        if ($node->extends && $node->extends->isSpecialClassName()) {
972
-            $this->emitError(new Error(
973
-                sprintf('Cannot use \'%s\' as class name as it is reserved', $node->extends),
974
-                $node->extends->getAttributes()
975
-            ));
976
-        }
977
-
978
-        $this->checkImplementedInterfaces($node->implements);
979
-    }
980
-
981
-    protected function checkInterface(Interface_ $node, $namePos) {
982
-        $this->checkClassName($node->name, $namePos);
983
-        $this->checkImplementedInterfaces($node->extends);
984
-    }
985
-
986
-    protected function checkEnum(Enum_ $node, $namePos) {
987
-        $this->checkClassName($node->name, $namePos);
988
-        $this->checkImplementedInterfaces($node->implements);
989
-    }
990
-
991
-    protected function checkClassMethod(ClassMethod $node, $modifierPos) {
992
-        if ($node->flags & Class_::MODIFIER_STATIC) {
993
-            switch ($node->name->toLowerString()) {
994
-                case '__construct':
995
-                    $this->emitError(new Error(
996
-                        sprintf('Constructor %s() cannot be static', $node->name),
997
-                        $this->getAttributesAt($modifierPos)));
998
-                    break;
999
-                case '__destruct':
1000
-                    $this->emitError(new Error(
1001
-                        sprintf('Destructor %s() cannot be static', $node->name),
1002
-                        $this->getAttributesAt($modifierPos)));
1003
-                    break;
1004
-                case '__clone':
1005
-                    $this->emitError(new Error(
1006
-                        sprintf('Clone method %s() cannot be static', $node->name),
1007
-                        $this->getAttributesAt($modifierPos)));
1008
-                    break;
1009
-            }
1010
-        }
1011
-
1012
-        if ($node->flags & Class_::MODIFIER_READONLY) {
1013
-            $this->emitError(new Error(
1014
-                sprintf('Method %s() cannot be readonly', $node->name),
1015
-                $this->getAttributesAt($modifierPos)));
1016
-        }
1017
-    }
1018
-
1019
-    protected function checkClassConst(ClassConst $node, $modifierPos) {
1020
-        if ($node->flags & Class_::MODIFIER_STATIC) {
1021
-            $this->emitError(new Error(
1022
-                "Cannot use 'static' as constant modifier",
1023
-                $this->getAttributesAt($modifierPos)));
1024
-        }
1025
-        if ($node->flags & Class_::MODIFIER_ABSTRACT) {
1026
-            $this->emitError(new Error(
1027
-                "Cannot use 'abstract' as constant modifier",
1028
-                $this->getAttributesAt($modifierPos)));
1029
-        }
1030
-        if ($node->flags & Class_::MODIFIER_READONLY) {
1031
-            $this->emitError(new Error(
1032
-                "Cannot use 'readonly' as constant modifier",
1033
-                $this->getAttributesAt($modifierPos)));
1034
-        }
1035
-    }
1036
-
1037
-    protected function checkProperty(Property $node, $modifierPos) {
1038
-        if ($node->flags & Class_::MODIFIER_ABSTRACT) {
1039
-            $this->emitError(new Error('Properties cannot be declared abstract',
1040
-                $this->getAttributesAt($modifierPos)));
1041
-        }
1042
-
1043
-        if ($node->flags & Class_::MODIFIER_FINAL) {
1044
-            $this->emitError(new Error('Properties cannot be declared final',
1045
-                $this->getAttributesAt($modifierPos)));
1046
-        }
1047
-    }
1048
-
1049
-    protected function checkUseUse(UseUse $node, $namePos) {
1050
-        if ($node->alias && $node->alias->isSpecialClassName()) {
1051
-            $this->emitError(new Error(
1052
-                sprintf(
1053
-                    'Cannot use %s as %s because \'%2$s\' is a special class name',
1054
-                    $node->name, $node->alias
1055
-                ),
1056
-                $this->getAttributesAt($namePos)
1057
-            ));
1058
-        }
1059
-    }
473
+	/**
474
+	 * Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions.
475
+	 *
476
+	 * @param Node\Stmt[] $stmts
477
+	 * @return Node\Stmt[]
478
+	 */
479
+	protected function handleNamespaces(array $stmts) : array {
480
+		$hasErrored = false;
481
+		$style = $this->getNamespacingStyle($stmts);
482
+		if (null === $style) {
483
+			// not namespaced, nothing to do
484
+			return $stmts;
485
+		} elseif ('brace' === $style) {
486
+			// For braced namespaces we only have to check that there are no invalid statements between the namespaces
487
+			$afterFirstNamespace = false;
488
+			foreach ($stmts as $stmt) {
489
+				if ($stmt instanceof Node\Stmt\Namespace_) {
490
+					$afterFirstNamespace = true;
491
+				} elseif (!$stmt instanceof Node\Stmt\HaltCompiler
492
+						&& !$stmt instanceof Node\Stmt\Nop
493
+						&& $afterFirstNamespace && !$hasErrored) {
494
+					$this->emitError(new Error(
495
+						'No code may exist outside of namespace {}', $stmt->getAttributes()));
496
+					$hasErrored = true; // Avoid one error for every statement
497
+				}
498
+			}
499
+			return $stmts;
500
+		} else {
501
+			// For semicolon namespaces we have to move the statements after a namespace declaration into ->stmts
502
+			$resultStmts = [];
503
+			$targetStmts =& $resultStmts;
504
+			$lastNs = null;
505
+			foreach ($stmts as $stmt) {
506
+				if ($stmt instanceof Node\Stmt\Namespace_) {
507
+					if ($lastNs !== null) {
508
+						$this->fixupNamespaceAttributes($lastNs);
509
+					}
510
+					if ($stmt->stmts === null) {
511
+						$stmt->stmts = [];
512
+						$targetStmts =& $stmt->stmts;
513
+						$resultStmts[] = $stmt;
514
+					} else {
515
+						// This handles the invalid case of mixed style namespaces
516
+						$resultStmts[] = $stmt;
517
+						$targetStmts =& $resultStmts;
518
+					}
519
+					$lastNs = $stmt;
520
+				} elseif ($stmt instanceof Node\Stmt\HaltCompiler) {
521
+					// __halt_compiler() is not moved into the namespace
522
+					$resultStmts[] = $stmt;
523
+				} else {
524
+					$targetStmts[] = $stmt;
525
+				}
526
+			}
527
+			if ($lastNs !== null) {
528
+				$this->fixupNamespaceAttributes($lastNs);
529
+			}
530
+			return $resultStmts;
531
+		}
532
+	}
533
+
534
+	private function fixupNamespaceAttributes(Node\Stmt\Namespace_ $stmt) {
535
+		// We moved the statements into the namespace node, as such the end of the namespace node
536
+		// needs to be extended to the end of the statements.
537
+		if (empty($stmt->stmts)) {
538
+			return;
539
+		}
540
+
541
+		// We only move the builtin end attributes here. This is the best we can do with the
542
+		// knowledge we have.
543
+		$endAttributes = ['endLine', 'endFilePos', 'endTokenPos'];
544
+		$lastStmt = $stmt->stmts[count($stmt->stmts) - 1];
545
+		foreach ($endAttributes as $endAttribute) {
546
+			if ($lastStmt->hasAttribute($endAttribute)) {
547
+				$stmt->setAttribute($endAttribute, $lastStmt->getAttribute($endAttribute));
548
+			}
549
+		}
550
+	}
551
+
552
+	/**
553
+	 * Determine namespacing style (semicolon or brace)
554
+	 *
555
+	 * @param Node[] $stmts Top-level statements.
556
+	 *
557
+	 * @return null|string One of "semicolon", "brace" or null (no namespaces)
558
+	 */
559
+	private function getNamespacingStyle(array $stmts) {
560
+		$style = null;
561
+		$hasNotAllowedStmts = false;
562
+		foreach ($stmts as $i => $stmt) {
563
+			if ($stmt instanceof Node\Stmt\Namespace_) {
564
+				$currentStyle = null === $stmt->stmts ? 'semicolon' : 'brace';
565
+				if (null === $style) {
566
+					$style = $currentStyle;
567
+					if ($hasNotAllowedStmts) {
568
+						$this->emitError(new Error(
569
+							'Namespace declaration statement has to be the very first statement in the script',
570
+							$stmt->getLine() // Avoid marking the entire namespace as an error
571
+						));
572
+					}
573
+				} elseif ($style !== $currentStyle) {
574
+					$this->emitError(new Error(
575
+						'Cannot mix bracketed namespace declarations with unbracketed namespace declarations',
576
+						$stmt->getLine() // Avoid marking the entire namespace as an error
577
+					));
578
+					// Treat like semicolon style for namespace normalization
579
+					return 'semicolon';
580
+				}
581
+				continue;
582
+			}
583
+
584
+			/* declare(), __halt_compiler() and nops can be used before a namespace declaration */
585
+			if ($stmt instanceof Node\Stmt\Declare_
586
+				|| $stmt instanceof Node\Stmt\HaltCompiler
587
+				|| $stmt instanceof Node\Stmt\Nop) {
588
+				continue;
589
+			}
590
+
591
+			/* There may be a hashbang line at the very start of the file */
592
+			if ($i === 0 && $stmt instanceof Node\Stmt\InlineHTML && preg_match('/\A#!.*\r?\n\z/', $stmt->value)) {
593
+				continue;
594
+			}
595
+
596
+			/* Everything else if forbidden before namespace declarations */
597
+			$hasNotAllowedStmts = true;
598
+		}
599
+		return $style;
600
+	}
601
+
602
+	/**
603
+	 * Fix up parsing of static property calls in PHP 5.
604
+	 *
605
+	 * In PHP 5 A::$b[c][d] and A::$b[c][d]() have very different interpretation. The former is
606
+	 * interpreted as (A::$b)[c][d], while the latter is the same as A::{$b[c][d]}(). We parse the
607
+	 * latter as the former initially and this method fixes the AST into the correct form when we
608
+	 * encounter the "()".
609
+	 *
610
+	 * @param  Node\Expr\StaticPropertyFetch|Node\Expr\ArrayDimFetch $prop
611
+	 * @param  Node\Arg[] $args
612
+	 * @param  array      $attributes
613
+	 *
614
+	 * @return Expr\StaticCall
615
+	 */
616
+	protected function fixupPhp5StaticPropCall($prop, array $args, array $attributes) : Expr\StaticCall {
617
+		if ($prop instanceof Node\Expr\StaticPropertyFetch) {
618
+			$name = $prop->name instanceof VarLikeIdentifier
619
+				? $prop->name->toString() : $prop->name;
620
+			$var = new Expr\Variable($name, $prop->name->getAttributes());
621
+			return new Expr\StaticCall($prop->class, $var, $args, $attributes);
622
+		} elseif ($prop instanceof Node\Expr\ArrayDimFetch) {
623
+			$tmp = $prop;
624
+			while ($tmp->var instanceof Node\Expr\ArrayDimFetch) {
625
+				$tmp = $tmp->var;
626
+			}
627
+
628
+			/** @var Expr\StaticPropertyFetch $staticProp */
629
+			$staticProp = $tmp->var;
630
+
631
+			// Set start attributes to attributes of innermost node
632
+			$tmp = $prop;
633
+			$this->fixupStartAttributes($tmp, $staticProp->name);
634
+			while ($tmp->var instanceof Node\Expr\ArrayDimFetch) {
635
+				$tmp = $tmp->var;
636
+				$this->fixupStartAttributes($tmp, $staticProp->name);
637
+			}
638
+
639
+			$name = $staticProp->name instanceof VarLikeIdentifier
640
+				? $staticProp->name->toString() : $staticProp->name;
641
+			$tmp->var = new Expr\Variable($name, $staticProp->name->getAttributes());
642
+			return new Expr\StaticCall($staticProp->class, $prop, $args, $attributes);
643
+		} else {
644
+			throw new \Exception;
645
+		}
646
+	}
647
+
648
+	protected function fixupStartAttributes(Node $to, Node $from) {
649
+		$startAttributes = ['startLine', 'startFilePos', 'startTokenPos'];
650
+		foreach ($startAttributes as $startAttribute) {
651
+			if ($from->hasAttribute($startAttribute)) {
652
+				$to->setAttribute($startAttribute, $from->getAttribute($startAttribute));
653
+			}
654
+		}
655
+	}
656
+
657
+	protected function handleBuiltinTypes(Name $name) {
658
+		$builtinTypes = [
659
+			'bool'     => true,
660
+			'int'      => true,
661
+			'float'    => true,
662
+			'string'   => true,
663
+			'iterable' => true,
664
+			'void'     => true,
665
+			'object'   => true,
666
+			'null'     => true,
667
+			'false'    => true,
668
+			'mixed'    => true,
669
+			'never'    => true,
670
+			'true'     => true,
671
+		];
672
+
673
+		if (!$name->isUnqualified()) {
674
+			return $name;
675
+		}
676
+
677
+		$lowerName = $name->toLowerString();
678
+		if (!isset($builtinTypes[$lowerName])) {
679
+			return $name;
680
+		}
681
+
682
+		return new Node\Identifier($lowerName, $name->getAttributes());
683
+	}
684
+
685
+	/**
686
+	 * Get combined start and end attributes at a stack location
687
+	 *
688
+	 * @param int $pos Stack location
689
+	 *
690
+	 * @return array Combined start and end attributes
691
+	 */
692
+	protected function getAttributesAt(int $pos) : array {
693
+		return $this->startAttributeStack[$pos] + $this->endAttributeStack[$pos];
694
+	}
695
+
696
+	protected function getFloatCastKind(string $cast): int
697
+	{
698
+		$cast = strtolower($cast);
699
+		if (strpos($cast, 'float') !== false) {
700
+			return Double::KIND_FLOAT;
701
+		}
702
+
703
+		if (strpos($cast, 'real') !== false) {
704
+			return Double::KIND_REAL;
705
+		}
706
+
707
+		return Double::KIND_DOUBLE;
708
+	}
709
+
710
+	protected function parseLNumber($str, $attributes, $allowInvalidOctal = false) {
711
+		try {
712
+			return LNumber::fromString($str, $attributes, $allowInvalidOctal);
713
+		} catch (Error $error) {
714
+			$this->emitError($error);
715
+			// Use dummy value
716
+			return new LNumber(0, $attributes);
717
+		}
718
+	}
719
+
720
+	/**
721
+	 * Parse a T_NUM_STRING token into either an integer or string node.
722
+	 *
723
+	 * @param string $str        Number string
724
+	 * @param array  $attributes Attributes
725
+	 *
726
+	 * @return LNumber|String_ Integer or string node.
727
+	 */
728
+	protected function parseNumString(string $str, array $attributes) {
729
+		if (!preg_match('/^(?:0|-?[1-9][0-9]*)$/', $str)) {
730
+			return new String_($str, $attributes);
731
+		}
732
+
733
+		$num = +$str;
734
+		if (!is_int($num)) {
735
+			return new String_($str, $attributes);
736
+		}
737
+
738
+		return new LNumber($num, $attributes);
739
+	}
740
+
741
+	protected function stripIndentation(
742
+		string $string, int $indentLen, string $indentChar,
743
+		bool $newlineAtStart, bool $newlineAtEnd, array $attributes
744
+	) {
745
+		if ($indentLen === 0) {
746
+			return $string;
747
+		}
748
+
749
+		$start = $newlineAtStart ? '(?:(?<=\n)|\A)' : '(?<=\n)';
750
+		$end = $newlineAtEnd ? '(?:(?=[\r\n])|\z)' : '(?=[\r\n])';
751
+		$regex = '/' . $start . '([ \t]*)(' . $end . ')?/';
752
+		return preg_replace_callback(
753
+			$regex,
754
+			function ($matches) use ($indentLen, $indentChar, $attributes) {
755
+				$prefix = substr($matches[1], 0, $indentLen);
756
+				if (false !== strpos($prefix, $indentChar === " " ? "\t" : " ")) {
757
+					$this->emitError(new Error(
758
+						'Invalid indentation - tabs and spaces cannot be mixed', $attributes
759
+					));
760
+				} elseif (strlen($prefix) < $indentLen && !isset($matches[2])) {
761
+					$this->emitError(new Error(
762
+						'Invalid body indentation level ' .
763
+						'(expecting an indentation level of at least ' . $indentLen . ')',
764
+						$attributes
765
+					));
766
+				}
767
+				return substr($matches[0], strlen($prefix));
768
+			},
769
+			$string
770
+		);
771
+	}
772
+
773
+	protected function parseDocString(
774
+		string $startToken, $contents, string $endToken,
775
+		array $attributes, array $endTokenAttributes, bool $parseUnicodeEscape
776
+	) {
777
+		$kind = strpos($startToken, "'") === false
778
+			? String_::KIND_HEREDOC : String_::KIND_NOWDOC;
779
+
780
+		$regex = '/\A[bB]?<<<[ \t]*[\'"]?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[\'"]?(?:\r\n|\n|\r)\z/';
781
+		$result = preg_match($regex, $startToken, $matches);
782
+		assert($result === 1);
783
+		$label = $matches[1];
784
+
785
+		$result = preg_match('/\A[ \t]*/', $endToken, $matches);
786
+		assert($result === 1);
787
+		$indentation = $matches[0];
788
+
789
+		$attributes['kind'] = $kind;
790
+		$attributes['docLabel'] = $label;
791
+		$attributes['docIndentation'] = $indentation;
792
+
793
+		$indentHasSpaces = false !== strpos($indentation, " ");
794
+		$indentHasTabs = false !== strpos($indentation, "\t");
795
+		if ($indentHasSpaces && $indentHasTabs) {
796
+			$this->emitError(new Error(
797
+				'Invalid indentation - tabs and spaces cannot be mixed',
798
+				$endTokenAttributes
799
+			));
800
+
801
+			// Proceed processing as if this doc string is not indented
802
+			$indentation = '';
803
+		}
804
+
805
+		$indentLen = \strlen($indentation);
806
+		$indentChar = $indentHasSpaces ? " " : "\t";
807
+
808
+		if (\is_string($contents)) {
809
+			if ($contents === '') {
810
+				return new String_('', $attributes);
811
+			}
812
+
813
+			$contents = $this->stripIndentation(
814
+				$contents, $indentLen, $indentChar, true, true, $attributes
815
+			);
816
+			$contents = preg_replace('~(\r\n|\n|\r)\z~', '', $contents);
817
+
818
+			if ($kind === String_::KIND_HEREDOC) {
819
+				$contents = String_::parseEscapeSequences($contents, null, $parseUnicodeEscape);
820
+			}
821
+
822
+			return new String_($contents, $attributes);
823
+		} else {
824
+			assert(count($contents) > 0);
825
+			if (!$contents[0] instanceof Node\Scalar\EncapsedStringPart) {
826
+				// If there is no leading encapsed string part, pretend there is an empty one
827
+				$this->stripIndentation(
828
+					'', $indentLen, $indentChar, true, false, $contents[0]->getAttributes()
829
+				);
830
+			}
831
+
832
+			$newContents = [];
833
+			foreach ($contents as $i => $part) {
834
+				if ($part instanceof Node\Scalar\EncapsedStringPart) {
835
+					$isLast = $i === \count($contents) - 1;
836
+					$part->value = $this->stripIndentation(
837
+						$part->value, $indentLen, $indentChar,
838
+						$i === 0, $isLast, $part->getAttributes()
839
+					);
840
+					$part->value = String_::parseEscapeSequences($part->value, null, $parseUnicodeEscape);
841
+					if ($isLast) {
842
+						$part->value = preg_replace('~(\r\n|\n|\r)\z~', '', $part->value);
843
+					}
844
+					if ('' === $part->value) {
845
+						continue;
846
+					}
847
+				}
848
+				$newContents[] = $part;
849
+			}
850
+			return new Encapsed($newContents, $attributes);
851
+		}
852
+	}
853
+
854
+	/**
855
+	 * Create attributes for a zero-length common-capturing nop.
856
+	 *
857
+	 * @param Comment[] $comments
858
+	 * @return array
859
+	 */
860
+	protected function createCommentNopAttributes(array $comments) {
861
+		$comment = $comments[count($comments) - 1];
862
+		$commentEndLine = $comment->getEndLine();
863
+		$commentEndFilePos = $comment->getEndFilePos();
864
+		$commentEndTokenPos = $comment->getEndTokenPos();
865
+
866
+		$attributes = ['comments' => $comments];
867
+		if (-1 !== $commentEndLine) {
868
+			$attributes['startLine'] = $commentEndLine;
869
+			$attributes['endLine'] = $commentEndLine;
870
+		}
871
+		if (-1 !== $commentEndFilePos) {
872
+			$attributes['startFilePos'] = $commentEndFilePos + 1;
873
+			$attributes['endFilePos'] = $commentEndFilePos;
874
+		}
875
+		if (-1 !== $commentEndTokenPos) {
876
+			$attributes['startTokenPos'] = $commentEndTokenPos + 1;
877
+			$attributes['endTokenPos'] = $commentEndTokenPos;
878
+		}
879
+		return $attributes;
880
+	}
881
+
882
+	/** @param ElseIf_|Else_ $node */
883
+	protected function fixupAlternativeElse($node) {
884
+		// Make sure a trailing nop statement carrying comments is part of the node.
885
+		$numStmts = \count($node->stmts);
886
+		if ($numStmts !== 0 && $node->stmts[$numStmts - 1] instanceof Nop) {
887
+			$nopAttrs = $node->stmts[$numStmts - 1]->getAttributes();
888
+			if (isset($nopAttrs['endLine'])) {
889
+				$node->setAttribute('endLine', $nopAttrs['endLine']);
890
+			}
891
+			if (isset($nopAttrs['endFilePos'])) {
892
+				$node->setAttribute('endFilePos', $nopAttrs['endFilePos']);
893
+			}
894
+			if (isset($nopAttrs['endTokenPos'])) {
895
+				$node->setAttribute('endTokenPos', $nopAttrs['endTokenPos']);
896
+			}
897
+		}
898
+	}
899
+
900
+	protected function checkClassModifier($a, $b, $modifierPos) {
901
+		try {
902
+			Class_::verifyClassModifier($a, $b);
903
+		} catch (Error $error) {
904
+			$error->setAttributes($this->getAttributesAt($modifierPos));
905
+			$this->emitError($error);
906
+		}
907
+	}
908
+
909
+	protected function checkModifier($a, $b, $modifierPos) {
910
+		// Jumping through some hoops here because verifyModifier() is also used elsewhere
911
+		try {
912
+			Class_::verifyModifier($a, $b);
913
+		} catch (Error $error) {
914
+			$error->setAttributes($this->getAttributesAt($modifierPos));
915
+			$this->emitError($error);
916
+		}
917
+	}
918
+
919
+	protected function checkParam(Param $node) {
920
+		if ($node->variadic && null !== $node->default) {
921
+			$this->emitError(new Error(
922
+				'Variadic parameter cannot have a default value',
923
+				$node->default->getAttributes()
924
+			));
925
+		}
926
+	}
927
+
928
+	protected function checkTryCatch(TryCatch $node) {
929
+		if (empty($node->catches) && null === $node->finally) {
930
+			$this->emitError(new Error(
931
+				'Cannot use try without catch or finally', $node->getAttributes()
932
+			));
933
+		}
934
+	}
935
+
936
+	protected function checkNamespace(Namespace_ $node) {
937
+		if (null !== $node->stmts) {
938
+			foreach ($node->stmts as $stmt) {
939
+				if ($stmt instanceof Namespace_) {
940
+					$this->emitError(new Error(
941
+						'Namespace declarations cannot be nested', $stmt->getAttributes()
942
+					));
943
+				}
944
+			}
945
+		}
946
+	}
947
+
948
+	private function checkClassName($name, $namePos) {
949
+		if (null !== $name && $name->isSpecialClassName()) {
950
+			$this->emitError(new Error(
951
+				sprintf('Cannot use \'%s\' as class name as it is reserved', $name),
952
+				$this->getAttributesAt($namePos)
953
+			));
954
+		}
955
+	}
956
+
957
+	private function checkImplementedInterfaces(array $interfaces) {
958
+		foreach ($interfaces as $interface) {
959
+			if ($interface->isSpecialClassName()) {
960
+				$this->emitError(new Error(
961
+					sprintf('Cannot use \'%s\' as interface name as it is reserved', $interface),
962
+					$interface->getAttributes()
963
+				));
964
+			}
965
+		}
966
+	}
967
+
968
+	protected function checkClass(Class_ $node, $namePos) {
969
+		$this->checkClassName($node->name, $namePos);
970
+
971
+		if ($node->extends && $node->extends->isSpecialClassName()) {
972
+			$this->emitError(new Error(
973
+				sprintf('Cannot use \'%s\' as class name as it is reserved', $node->extends),
974
+				$node->extends->getAttributes()
975
+			));
976
+		}
977
+
978
+		$this->checkImplementedInterfaces($node->implements);
979
+	}
980
+
981
+	protected function checkInterface(Interface_ $node, $namePos) {
982
+		$this->checkClassName($node->name, $namePos);
983
+		$this->checkImplementedInterfaces($node->extends);
984
+	}
985
+
986
+	protected function checkEnum(Enum_ $node, $namePos) {
987
+		$this->checkClassName($node->name, $namePos);
988
+		$this->checkImplementedInterfaces($node->implements);
989
+	}
990
+
991
+	protected function checkClassMethod(ClassMethod $node, $modifierPos) {
992
+		if ($node->flags & Class_::MODIFIER_STATIC) {
993
+			switch ($node->name->toLowerString()) {
994
+				case '__construct':
995
+					$this->emitError(new Error(
996
+						sprintf('Constructor %s() cannot be static', $node->name),
997
+						$this->getAttributesAt($modifierPos)));
998
+					break;
999
+				case '__destruct':
1000
+					$this->emitError(new Error(
1001
+						sprintf('Destructor %s() cannot be static', $node->name),
1002
+						$this->getAttributesAt($modifierPos)));
1003
+					break;
1004
+				case '__clone':
1005
+					$this->emitError(new Error(
1006
+						sprintf('Clone method %s() cannot be static', $node->name),
1007
+						$this->getAttributesAt($modifierPos)));
1008
+					break;
1009
+			}
1010
+		}
1011
+
1012
+		if ($node->flags & Class_::MODIFIER_READONLY) {
1013
+			$this->emitError(new Error(
1014
+				sprintf('Method %s() cannot be readonly', $node->name),
1015
+				$this->getAttributesAt($modifierPos)));
1016
+		}
1017
+	}
1018
+
1019
+	protected function checkClassConst(ClassConst $node, $modifierPos) {
1020
+		if ($node->flags & Class_::MODIFIER_STATIC) {
1021
+			$this->emitError(new Error(
1022
+				"Cannot use 'static' as constant modifier",
1023
+				$this->getAttributesAt($modifierPos)));
1024
+		}
1025
+		if ($node->flags & Class_::MODIFIER_ABSTRACT) {
1026
+			$this->emitError(new Error(
1027
+				"Cannot use 'abstract' as constant modifier",
1028
+				$this->getAttributesAt($modifierPos)));
1029
+		}
1030
+		if ($node->flags & Class_::MODIFIER_READONLY) {
1031
+			$this->emitError(new Error(
1032
+				"Cannot use 'readonly' as constant modifier",
1033
+				$this->getAttributesAt($modifierPos)));
1034
+		}
1035
+	}
1036
+
1037
+	protected function checkProperty(Property $node, $modifierPos) {
1038
+		if ($node->flags & Class_::MODIFIER_ABSTRACT) {
1039
+			$this->emitError(new Error('Properties cannot be declared abstract',
1040
+				$this->getAttributesAt($modifierPos)));
1041
+		}
1042
+
1043
+		if ($node->flags & Class_::MODIFIER_FINAL) {
1044
+			$this->emitError(new Error('Properties cannot be declared final',
1045
+				$this->getAttributesAt($modifierPos)));
1046
+		}
1047
+	}
1048
+
1049
+	protected function checkUseUse(UseUse $node, $namePos) {
1050
+		if ($node->alias && $node->alias->isSpecialClassName()) {
1051
+			$this->emitError(new Error(
1052
+				sprintf(
1053
+					'Cannot use %s as %s because \'%2$s\' is a special class name',
1054
+					$node->name, $node->alias
1055
+				),
1056
+				$this->getAttributesAt($namePos)
1057
+			));
1058
+		}
1059
+	}
1060 1060
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -390,10 +390,10 @@  discard block
 block discarded – undo
390 390
     protected function getErrorMessage(int $symbol, int $state) : string {
391 391
         $expectedString = '';
392 392
         if ($expected = $this->getExpectedTokens($state)) {
393
-            $expectedString = ', expecting ' . implode(' or ', $expected);
393
+            $expectedString = ', expecting '.implode(' or ', $expected);
394 394
         }
395 395
 
396
-        return 'Syntax error, unexpected ' . $this->symbolToName[$symbol] . $expectedString;
396
+        return 'Syntax error, unexpected '.$this->symbolToName[$symbol].$expectedString;
397 397
     }
398 398
 
399 399
     /**
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
         } else {
501 501
             // For semicolon namespaces we have to move the statements after a namespace declaration into ->stmts
502 502
             $resultStmts = [];
503
-            $targetStmts =& $resultStmts;
503
+            $targetStmts = & $resultStmts;
504 504
             $lastNs = null;
505 505
             foreach ($stmts as $stmt) {
506 506
                 if ($stmt instanceof Node\Stmt\Namespace_) {
@@ -509,12 +509,12 @@  discard block
 block discarded – undo
509 509
                     }
510 510
                     if ($stmt->stmts === null) {
511 511
                         $stmt->stmts = [];
512
-                        $targetStmts =& $stmt->stmts;
512
+                        $targetStmts = & $stmt->stmts;
513 513
                         $resultStmts[] = $stmt;
514 514
                     } else {
515 515
                         // This handles the invalid case of mixed style namespaces
516 516
                         $resultStmts[] = $stmt;
517
-                        $targetStmts =& $resultStmts;
517
+                        $targetStmts = & $resultStmts;
518 518
                     }
519 519
                     $lastNs = $stmt;
520 520
                 } elseif ($stmt instanceof Node\Stmt\HaltCompiler) {
@@ -748,10 +748,10 @@  discard block
 block discarded – undo
748 748
 
749 749
         $start = $newlineAtStart ? '(?:(?<=\n)|\A)' : '(?<=\n)';
750 750
         $end = $newlineAtEnd ? '(?:(?=[\r\n])|\z)' : '(?=[\r\n])';
751
-        $regex = '/' . $start . '([ \t]*)(' . $end . ')?/';
751
+        $regex = '/'.$start.'([ \t]*)('.$end.')?/';
752 752
         return preg_replace_callback(
753 753
             $regex,
754
-            function ($matches) use ($indentLen, $indentChar, $attributes) {
754
+            function($matches) use ($indentLen, $indentChar, $attributes) {
755 755
                 $prefix = substr($matches[1], 0, $indentLen);
756 756
                 if (false !== strpos($prefix, $indentChar === " " ? "\t" : " ")) {
757 757
                     $this->emitError(new Error(
@@ -759,8 +759,8 @@  discard block
 block discarded – undo
759 759
                     ));
760 760
                 } elseif (strlen($prefix) < $indentLen && !isset($matches[2])) {
761 761
                     $this->emitError(new Error(
762
-                        'Invalid body indentation level ' .
763
-                        '(expecting an indentation level of at least ' . $indentLen . ')',
762
+                        'Invalid body indentation level '.
763
+                        '(expecting an indentation level of at least '.$indentLen.')',
764 764
                         $attributes
765 765
                     ));
766 766
                 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@
 block discarded – undo
27 27
 use PhpParser\Node\Stmt\UseUse;
28 28
 use PhpParser\Node\VarLikeIdentifier;
29 29
 
30
-abstract class ParserAbstract implements Parser
31
-{
30
+abstract class ParserAbstract implements Parser {
32 31
     const SYMBOL_NONE = -1;
33 32
 
34 33
     /*
Please login to merge, or discard this patch.
php-scoper/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php 2 patches
Indentation   +384 added lines, -384 removed lines patch added patch discarded remove patch
@@ -12,388 +12,388 @@
 block discarded – undo
12 12
 
13 13
 class BuilderFactory
14 14
 {
15
-    /**
16
-     * Creates an attribute node.
17
-     *
18
-     * @param string|Name $name Name of the attribute
19
-     * @param array       $args Attribute named arguments
20
-     *
21
-     * @return Node\Attribute
22
-     */
23
-    public function attribute($name, array $args = []) : Node\Attribute {
24
-        return new Node\Attribute(
25
-            BuilderHelpers::normalizeName($name),
26
-            $this->args($args)
27
-        );
28
-    }
29
-
30
-    /**
31
-     * Creates a namespace builder.
32
-     *
33
-     * @param null|string|Node\Name $name Name of the namespace
34
-     *
35
-     * @return Builder\Namespace_ The created namespace builder
36
-     */
37
-    public function namespace($name) : Builder\Namespace_ {
38
-        return new Builder\Namespace_($name);
39
-    }
40
-
41
-    /**
42
-     * Creates a class builder.
43
-     *
44
-     * @param string $name Name of the class
45
-     *
46
-     * @return Builder\Class_ The created class builder
47
-     */
48
-    public function class(string $name) : Builder\Class_ {
49
-        return new Builder\Class_($name);
50
-    }
51
-
52
-    /**
53
-     * Creates an interface builder.
54
-     *
55
-     * @param string $name Name of the interface
56
-     *
57
-     * @return Builder\Interface_ The created interface builder
58
-     */
59
-    public function interface(string $name) : Builder\Interface_ {
60
-        return new Builder\Interface_($name);
61
-    }
62
-
63
-    /**
64
-     * Creates a trait builder.
65
-     *
66
-     * @param string $name Name of the trait
67
-     *
68
-     * @return Builder\Trait_ The created trait builder
69
-     */
70
-    public function trait(string $name) : Builder\Trait_ {
71
-        return new Builder\Trait_($name);
72
-    }
73
-
74
-    /**
75
-     * Creates an enum builder.
76
-     *
77
-     * @param string $name Name of the enum
78
-     *
79
-     * @return Builder\Enum_ The created enum builder
80
-     */
81
-    public function enum(string $name) : Builder\Enum_ {
82
-        return new Builder\Enum_($name);
83
-    }
84
-
85
-    /**
86
-     * Creates a trait use builder.
87
-     *
88
-     * @param Node\Name|string ...$traits Trait names
89
-     *
90
-     * @return Builder\TraitUse The create trait use builder
91
-     */
92
-    public function useTrait(...$traits) : Builder\TraitUse {
93
-        return new Builder\TraitUse(...$traits);
94
-    }
95
-
96
-    /**
97
-     * Creates a trait use adaptation builder.
98
-     *
99
-     * @param Node\Name|string|null  $trait  Trait name
100
-     * @param Node\Identifier|string $method Method name
101
-     *
102
-     * @return Builder\TraitUseAdaptation The create trait use adaptation builder
103
-     */
104
-    public function traitUseAdaptation($trait, $method = null) : Builder\TraitUseAdaptation {
105
-        if ($method === null) {
106
-            $method = $trait;
107
-            $trait = null;
108
-        }
109
-
110
-        return new Builder\TraitUseAdaptation($trait, $method);
111
-    }
112
-
113
-    /**
114
-     * Creates a method builder.
115
-     *
116
-     * @param string $name Name of the method
117
-     *
118
-     * @return Builder\Method The created method builder
119
-     */
120
-    public function method(string $name) : Builder\Method {
121
-        return new Builder\Method($name);
122
-    }
123
-
124
-    /**
125
-     * Creates a parameter builder.
126
-     *
127
-     * @param string $name Name of the parameter
128
-     *
129
-     * @return Builder\Param The created parameter builder
130
-     */
131
-    public function param(string $name) : Builder\Param {
132
-        return new Builder\Param($name);
133
-    }
134
-
135
-    /**
136
-     * Creates a property builder.
137
-     *
138
-     * @param string $name Name of the property
139
-     *
140
-     * @return Builder\Property The created property builder
141
-     */
142
-    public function property(string $name) : Builder\Property {
143
-        return new Builder\Property($name);
144
-    }
145
-
146
-    /**
147
-     * Creates a function builder.
148
-     *
149
-     * @param string $name Name of the function
150
-     *
151
-     * @return Builder\Function_ The created function builder
152
-     */
153
-    public function function(string $name) : Builder\Function_ {
154
-        return new Builder\Function_($name);
155
-    }
156
-
157
-    /**
158
-     * Creates a namespace/class use builder.
159
-     *
160
-     * @param Node\Name|string $name Name of the entity (namespace or class) to alias
161
-     *
162
-     * @return Builder\Use_ The created use builder
163
-     */
164
-    public function use($name) : Builder\Use_ {
165
-        return new Builder\Use_($name, Use_::TYPE_NORMAL);
166
-    }
167
-
168
-    /**
169
-     * Creates a function use builder.
170
-     *
171
-     * @param Node\Name|string $name Name of the function to alias
172
-     *
173
-     * @return Builder\Use_ The created use function builder
174
-     */
175
-    public function useFunction($name) : Builder\Use_ {
176
-        return new Builder\Use_($name, Use_::TYPE_FUNCTION);
177
-    }
178
-
179
-    /**
180
-     * Creates a constant use builder.
181
-     *
182
-     * @param Node\Name|string $name Name of the const to alias
183
-     *
184
-     * @return Builder\Use_ The created use const builder
185
-     */
186
-    public function useConst($name) : Builder\Use_ {
187
-        return new Builder\Use_($name, Use_::TYPE_CONSTANT);
188
-    }
189
-
190
-    /**
191
-     * Creates a class constant builder.
192
-     *
193
-     * @param string|Identifier                          $name  Name
194
-     * @param Node\Expr|bool|null|int|float|string|array $value Value
195
-     *
196
-     * @return Builder\ClassConst The created use const builder
197
-     */
198
-    public function classConst($name, $value) : Builder\ClassConst {
199
-        return new Builder\ClassConst($name, $value);
200
-    }
201
-
202
-    /**
203
-     * Creates an enum case builder.
204
-     *
205
-     * @param string|Identifier $name  Name
206
-     *
207
-     * @return Builder\EnumCase The created use const builder
208
-     */
209
-    public function enumCase($name) : Builder\EnumCase {
210
-        return new Builder\EnumCase($name);
211
-    }
212
-
213
-    /**
214
-     * Creates node a for a literal value.
215
-     *
216
-     * @param Expr|bool|null|int|float|string|array $value $value
217
-     *
218
-     * @return Expr
219
-     */
220
-    public function val($value) : Expr {
221
-        return BuilderHelpers::normalizeValue($value);
222
-    }
223
-
224
-    /**
225
-     * Creates variable node.
226
-     *
227
-     * @param string|Expr $name Name
228
-     *
229
-     * @return Expr\Variable
230
-     */
231
-    public function var($name) : Expr\Variable {
232
-        if (!\is_string($name) && !$name instanceof Expr) {
233
-            throw new \LogicException('Variable name must be string or Expr');
234
-        }
235
-
236
-        return new Expr\Variable($name);
237
-    }
238
-
239
-    /**
240
-     * Normalizes an argument list.
241
-     *
242
-     * Creates Arg nodes for all arguments and converts literal values to expressions.
243
-     *
244
-     * @param array $args List of arguments to normalize
245
-     *
246
-     * @return Arg[]
247
-     */
248
-    public function args(array $args) : array {
249
-        $normalizedArgs = [];
250
-        foreach ($args as $key => $arg) {
251
-            if (!($arg instanceof Arg)) {
252
-                $arg = new Arg(BuilderHelpers::normalizeValue($arg));
253
-            }
254
-            if (\is_string($key)) {
255
-                $arg->name = BuilderHelpers::normalizeIdentifier($key);
256
-            }
257
-            $normalizedArgs[] = $arg;
258
-        }
259
-        return $normalizedArgs;
260
-    }
261
-
262
-    /**
263
-     * Creates a function call node.
264
-     *
265
-     * @param string|Name|Expr $name Function name
266
-     * @param array            $args Function arguments
267
-     *
268
-     * @return Expr\FuncCall
269
-     */
270
-    public function funcCall($name, array $args = []) : Expr\FuncCall {
271
-        return new Expr\FuncCall(
272
-            BuilderHelpers::normalizeNameOrExpr($name),
273
-            $this->args($args)
274
-        );
275
-    }
276
-
277
-    /**
278
-     * Creates a method call node.
279
-     *
280
-     * @param Expr                   $var  Variable the method is called on
281
-     * @param string|Identifier|Expr $name Method name
282
-     * @param array                  $args Method arguments
283
-     *
284
-     * @return Expr\MethodCall
285
-     */
286
-    public function methodCall(Expr $var, $name, array $args = []) : Expr\MethodCall {
287
-        return new Expr\MethodCall(
288
-            $var,
289
-            BuilderHelpers::normalizeIdentifierOrExpr($name),
290
-            $this->args($args)
291
-        );
292
-    }
293
-
294
-    /**
295
-     * Creates a static method call node.
296
-     *
297
-     * @param string|Name|Expr       $class Class name
298
-     * @param string|Identifier|Expr $name  Method name
299
-     * @param array                  $args  Method arguments
300
-     *
301
-     * @return Expr\StaticCall
302
-     */
303
-    public function staticCall($class, $name, array $args = []) : Expr\StaticCall {
304
-        return new Expr\StaticCall(
305
-            BuilderHelpers::normalizeNameOrExpr($class),
306
-            BuilderHelpers::normalizeIdentifierOrExpr($name),
307
-            $this->args($args)
308
-        );
309
-    }
310
-
311
-    /**
312
-     * Creates an object creation node.
313
-     *
314
-     * @param string|Name|Expr $class Class name
315
-     * @param array            $args  Constructor arguments
316
-     *
317
-     * @return Expr\New_
318
-     */
319
-    public function new($class, array $args = []) : Expr\New_ {
320
-        return new Expr\New_(
321
-            BuilderHelpers::normalizeNameOrExpr($class),
322
-            $this->args($args)
323
-        );
324
-    }
325
-
326
-    /**
327
-     * Creates a constant fetch node.
328
-     *
329
-     * @param string|Name $name Constant name
330
-     *
331
-     * @return Expr\ConstFetch
332
-     */
333
-    public function constFetch($name) : Expr\ConstFetch {
334
-        return new Expr\ConstFetch(BuilderHelpers::normalizeName($name));
335
-    }
336
-
337
-    /**
338
-     * Creates a property fetch node.
339
-     *
340
-     * @param Expr                   $var  Variable holding object
341
-     * @param string|Identifier|Expr $name Property name
342
-     *
343
-     * @return Expr\PropertyFetch
344
-     */
345
-    public function propertyFetch(Expr $var, $name) : Expr\PropertyFetch {
346
-        return new Expr\PropertyFetch($var, BuilderHelpers::normalizeIdentifierOrExpr($name));
347
-    }
348
-
349
-    /**
350
-     * Creates a class constant fetch node.
351
-     *
352
-     * @param string|Name|Expr $class Class name
353
-     * @param string|Identifier|Expr $name  Constant name
354
-     *
355
-     * @return Expr\ClassConstFetch
356
-     */
357
-    public function classConstFetch($class, $name): Expr\ClassConstFetch {
358
-        return new Expr\ClassConstFetch(
359
-            BuilderHelpers::normalizeNameOrExpr($class),
360
-            BuilderHelpers::normalizeIdentifierOrExpr($name)
361
-        );
362
-    }
363
-
364
-    /**
365
-     * Creates nested Concat nodes from a list of expressions.
366
-     *
367
-     * @param Expr|string ...$exprs Expressions or literal strings
368
-     *
369
-     * @return Concat
370
-     */
371
-    public function concat(...$exprs) : Concat {
372
-        $numExprs = count($exprs);
373
-        if ($numExprs < 2) {
374
-            throw new \LogicException('Expected at least two expressions');
375
-        }
376
-
377
-        $lastConcat = $this->normalizeStringExpr($exprs[0]);
378
-        for ($i = 1; $i < $numExprs; $i++) {
379
-            $lastConcat = new Concat($lastConcat, $this->normalizeStringExpr($exprs[$i]));
380
-        }
381
-        return $lastConcat;
382
-    }
383
-
384
-    /**
385
-     * @param string|Expr $expr
386
-     * @return Expr
387
-     */
388
-    private function normalizeStringExpr($expr) : Expr {
389
-        if ($expr instanceof Expr) {
390
-            return $expr;
391
-        }
392
-
393
-        if (\is_string($expr)) {
394
-            return new String_($expr);
395
-        }
396
-
397
-        throw new \LogicException('Expected string or Expr');
398
-    }
15
+	/**
16
+	 * Creates an attribute node.
17
+	 *
18
+	 * @param string|Name $name Name of the attribute
19
+	 * @param array       $args Attribute named arguments
20
+	 *
21
+	 * @return Node\Attribute
22
+	 */
23
+	public function attribute($name, array $args = []) : Node\Attribute {
24
+		return new Node\Attribute(
25
+			BuilderHelpers::normalizeName($name),
26
+			$this->args($args)
27
+		);
28
+	}
29
+
30
+	/**
31
+	 * Creates a namespace builder.
32
+	 *
33
+	 * @param null|string|Node\Name $name Name of the namespace
34
+	 *
35
+	 * @return Builder\Namespace_ The created namespace builder
36
+	 */
37
+	public function namespace($name) : Builder\Namespace_ {
38
+		return new Builder\Namespace_($name);
39
+	}
40
+
41
+	/**
42
+	 * Creates a class builder.
43
+	 *
44
+	 * @param string $name Name of the class
45
+	 *
46
+	 * @return Builder\Class_ The created class builder
47
+	 */
48
+	public function class(string $name) : Builder\Class_ {
49
+		return new Builder\Class_($name);
50
+	}
51
+
52
+	/**
53
+	 * Creates an interface builder.
54
+	 *
55
+	 * @param string $name Name of the interface
56
+	 *
57
+	 * @return Builder\Interface_ The created interface builder
58
+	 */
59
+	public function interface(string $name) : Builder\Interface_ {
60
+		return new Builder\Interface_($name);
61
+	}
62
+
63
+	/**
64
+	 * Creates a trait builder.
65
+	 *
66
+	 * @param string $name Name of the trait
67
+	 *
68
+	 * @return Builder\Trait_ The created trait builder
69
+	 */
70
+	public function trait(string $name) : Builder\Trait_ {
71
+		return new Builder\Trait_($name);
72
+	}
73
+
74
+	/**
75
+	 * Creates an enum builder.
76
+	 *
77
+	 * @param string $name Name of the enum
78
+	 *
79
+	 * @return Builder\Enum_ The created enum builder
80
+	 */
81
+	public function enum(string $name) : Builder\Enum_ {
82
+		return new Builder\Enum_($name);
83
+	}
84
+
85
+	/**
86
+	 * Creates a trait use builder.
87
+	 *
88
+	 * @param Node\Name|string ...$traits Trait names
89
+	 *
90
+	 * @return Builder\TraitUse The create trait use builder
91
+	 */
92
+	public function useTrait(...$traits) : Builder\TraitUse {
93
+		return new Builder\TraitUse(...$traits);
94
+	}
95
+
96
+	/**
97
+	 * Creates a trait use adaptation builder.
98
+	 *
99
+	 * @param Node\Name|string|null  $trait  Trait name
100
+	 * @param Node\Identifier|string $method Method name
101
+	 *
102
+	 * @return Builder\TraitUseAdaptation The create trait use adaptation builder
103
+	 */
104
+	public function traitUseAdaptation($trait, $method = null) : Builder\TraitUseAdaptation {
105
+		if ($method === null) {
106
+			$method = $trait;
107
+			$trait = null;
108
+		}
109
+
110
+		return new Builder\TraitUseAdaptation($trait, $method);
111
+	}
112
+
113
+	/**
114
+	 * Creates a method builder.
115
+	 *
116
+	 * @param string $name Name of the method
117
+	 *
118
+	 * @return Builder\Method The created method builder
119
+	 */
120
+	public function method(string $name) : Builder\Method {
121
+		return new Builder\Method($name);
122
+	}
123
+
124
+	/**
125
+	 * Creates a parameter builder.
126
+	 *
127
+	 * @param string $name Name of the parameter
128
+	 *
129
+	 * @return Builder\Param The created parameter builder
130
+	 */
131
+	public function param(string $name) : Builder\Param {
132
+		return new Builder\Param($name);
133
+	}
134
+
135
+	/**
136
+	 * Creates a property builder.
137
+	 *
138
+	 * @param string $name Name of the property
139
+	 *
140
+	 * @return Builder\Property The created property builder
141
+	 */
142
+	public function property(string $name) : Builder\Property {
143
+		return new Builder\Property($name);
144
+	}
145
+
146
+	/**
147
+	 * Creates a function builder.
148
+	 *
149
+	 * @param string $name Name of the function
150
+	 *
151
+	 * @return Builder\Function_ The created function builder
152
+	 */
153
+	public function function(string $name) : Builder\Function_ {
154
+		return new Builder\Function_($name);
155
+	}
156
+
157
+	/**
158
+	 * Creates a namespace/class use builder.
159
+	 *
160
+	 * @param Node\Name|string $name Name of the entity (namespace or class) to alias
161
+	 *
162
+	 * @return Builder\Use_ The created use builder
163
+	 */
164
+	public function use($name) : Builder\Use_ {
165
+		return new Builder\Use_($name, Use_::TYPE_NORMAL);
166
+	}
167
+
168
+	/**
169
+	 * Creates a function use builder.
170
+	 *
171
+	 * @param Node\Name|string $name Name of the function to alias
172
+	 *
173
+	 * @return Builder\Use_ The created use function builder
174
+	 */
175
+	public function useFunction($name) : Builder\Use_ {
176
+		return new Builder\Use_($name, Use_::TYPE_FUNCTION);
177
+	}
178
+
179
+	/**
180
+	 * Creates a constant use builder.
181
+	 *
182
+	 * @param Node\Name|string $name Name of the const to alias
183
+	 *
184
+	 * @return Builder\Use_ The created use const builder
185
+	 */
186
+	public function useConst($name) : Builder\Use_ {
187
+		return new Builder\Use_($name, Use_::TYPE_CONSTANT);
188
+	}
189
+
190
+	/**
191
+	 * Creates a class constant builder.
192
+	 *
193
+	 * @param string|Identifier                          $name  Name
194
+	 * @param Node\Expr|bool|null|int|float|string|array $value Value
195
+	 *
196
+	 * @return Builder\ClassConst The created use const builder
197
+	 */
198
+	public function classConst($name, $value) : Builder\ClassConst {
199
+		return new Builder\ClassConst($name, $value);
200
+	}
201
+
202
+	/**
203
+	 * Creates an enum case builder.
204
+	 *
205
+	 * @param string|Identifier $name  Name
206
+	 *
207
+	 * @return Builder\EnumCase The created use const builder
208
+	 */
209
+	public function enumCase($name) : Builder\EnumCase {
210
+		return new Builder\EnumCase($name);
211
+	}
212
+
213
+	/**
214
+	 * Creates node a for a literal value.
215
+	 *
216
+	 * @param Expr|bool|null|int|float|string|array $value $value
217
+	 *
218
+	 * @return Expr
219
+	 */
220
+	public function val($value) : Expr {
221
+		return BuilderHelpers::normalizeValue($value);
222
+	}
223
+
224
+	/**
225
+	 * Creates variable node.
226
+	 *
227
+	 * @param string|Expr $name Name
228
+	 *
229
+	 * @return Expr\Variable
230
+	 */
231
+	public function var($name) : Expr\Variable {
232
+		if (!\is_string($name) && !$name instanceof Expr) {
233
+			throw new \LogicException('Variable name must be string or Expr');
234
+		}
235
+
236
+		return new Expr\Variable($name);
237
+	}
238
+
239
+	/**
240
+	 * Normalizes an argument list.
241
+	 *
242
+	 * Creates Arg nodes for all arguments and converts literal values to expressions.
243
+	 *
244
+	 * @param array $args List of arguments to normalize
245
+	 *
246
+	 * @return Arg[]
247
+	 */
248
+	public function args(array $args) : array {
249
+		$normalizedArgs = [];
250
+		foreach ($args as $key => $arg) {
251
+			if (!($arg instanceof Arg)) {
252
+				$arg = new Arg(BuilderHelpers::normalizeValue($arg));
253
+			}
254
+			if (\is_string($key)) {
255
+				$arg->name = BuilderHelpers::normalizeIdentifier($key);
256
+			}
257
+			$normalizedArgs[] = $arg;
258
+		}
259
+		return $normalizedArgs;
260
+	}
261
+
262
+	/**
263
+	 * Creates a function call node.
264
+	 *
265
+	 * @param string|Name|Expr $name Function name
266
+	 * @param array            $args Function arguments
267
+	 *
268
+	 * @return Expr\FuncCall
269
+	 */
270
+	public function funcCall($name, array $args = []) : Expr\FuncCall {
271
+		return new Expr\FuncCall(
272
+			BuilderHelpers::normalizeNameOrExpr($name),
273
+			$this->args($args)
274
+		);
275
+	}
276
+
277
+	/**
278
+	 * Creates a method call node.
279
+	 *
280
+	 * @param Expr                   $var  Variable the method is called on
281
+	 * @param string|Identifier|Expr $name Method name
282
+	 * @param array                  $args Method arguments
283
+	 *
284
+	 * @return Expr\MethodCall
285
+	 */
286
+	public function methodCall(Expr $var, $name, array $args = []) : Expr\MethodCall {
287
+		return new Expr\MethodCall(
288
+			$var,
289
+			BuilderHelpers::normalizeIdentifierOrExpr($name),
290
+			$this->args($args)
291
+		);
292
+	}
293
+
294
+	/**
295
+	 * Creates a static method call node.
296
+	 *
297
+	 * @param string|Name|Expr       $class Class name
298
+	 * @param string|Identifier|Expr $name  Method name
299
+	 * @param array                  $args  Method arguments
300
+	 *
301
+	 * @return Expr\StaticCall
302
+	 */
303
+	public function staticCall($class, $name, array $args = []) : Expr\StaticCall {
304
+		return new Expr\StaticCall(
305
+			BuilderHelpers::normalizeNameOrExpr($class),
306
+			BuilderHelpers::normalizeIdentifierOrExpr($name),
307
+			$this->args($args)
308
+		);
309
+	}
310
+
311
+	/**
312
+	 * Creates an object creation node.
313
+	 *
314
+	 * @param string|Name|Expr $class Class name
315
+	 * @param array            $args  Constructor arguments
316
+	 *
317
+	 * @return Expr\New_
318
+	 */
319
+	public function new($class, array $args = []) : Expr\New_ {
320
+		return new Expr\New_(
321
+			BuilderHelpers::normalizeNameOrExpr($class),
322
+			$this->args($args)
323
+		);
324
+	}
325
+
326
+	/**
327
+	 * Creates a constant fetch node.
328
+	 *
329
+	 * @param string|Name $name Constant name
330
+	 *
331
+	 * @return Expr\ConstFetch
332
+	 */
333
+	public function constFetch($name) : Expr\ConstFetch {
334
+		return new Expr\ConstFetch(BuilderHelpers::normalizeName($name));
335
+	}
336
+
337
+	/**
338
+	 * Creates a property fetch node.
339
+	 *
340
+	 * @param Expr                   $var  Variable holding object
341
+	 * @param string|Identifier|Expr $name Property name
342
+	 *
343
+	 * @return Expr\PropertyFetch
344
+	 */
345
+	public function propertyFetch(Expr $var, $name) : Expr\PropertyFetch {
346
+		return new Expr\PropertyFetch($var, BuilderHelpers::normalizeIdentifierOrExpr($name));
347
+	}
348
+
349
+	/**
350
+	 * Creates a class constant fetch node.
351
+	 *
352
+	 * @param string|Name|Expr $class Class name
353
+	 * @param string|Identifier|Expr $name  Constant name
354
+	 *
355
+	 * @return Expr\ClassConstFetch
356
+	 */
357
+	public function classConstFetch($class, $name): Expr\ClassConstFetch {
358
+		return new Expr\ClassConstFetch(
359
+			BuilderHelpers::normalizeNameOrExpr($class),
360
+			BuilderHelpers::normalizeIdentifierOrExpr($name)
361
+		);
362
+	}
363
+
364
+	/**
365
+	 * Creates nested Concat nodes from a list of expressions.
366
+	 *
367
+	 * @param Expr|string ...$exprs Expressions or literal strings
368
+	 *
369
+	 * @return Concat
370
+	 */
371
+	public function concat(...$exprs) : Concat {
372
+		$numExprs = count($exprs);
373
+		if ($numExprs < 2) {
374
+			throw new \LogicException('Expected at least two expressions');
375
+		}
376
+
377
+		$lastConcat = $this->normalizeStringExpr($exprs[0]);
378
+		for ($i = 1; $i < $numExprs; $i++) {
379
+			$lastConcat = new Concat($lastConcat, $this->normalizeStringExpr($exprs[$i]));
380
+		}
381
+		return $lastConcat;
382
+	}
383
+
384
+	/**
385
+	 * @param string|Expr $expr
386
+	 * @return Expr
387
+	 */
388
+	private function normalizeStringExpr($expr) : Expr {
389
+		if ($expr instanceof Expr) {
390
+			return $expr;
391
+		}
392
+
393
+		if (\is_string($expr)) {
394
+			return new String_($expr);
395
+		}
396
+
397
+		throw new \LogicException('Expected string or Expr');
398
+	}
399 399
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@
 block discarded – undo
10 10
 use PhpParser\Node\Scalar\String_;
11 11
 use PhpParser\Node\Stmt\Use_;
12 12
 
13
-class BuilderFactory
14
-{
13
+class BuilderFactory {
15 14
     /**
16 15
      * Creates an attribute node.
17 16
      *
Please login to merge, or discard this patch.
php-scoper/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php 3 patches
Indentation   +149 added lines, -149 removed lines patch added patch discarded remove patch
@@ -12,153 +12,153 @@
 block discarded – undo
12 12
  */
13 13
 class Differ
14 14
 {
15
-    private $isEqual;
16
-
17
-    /**
18
-     * Create differ over the given equality relation.
19
-     *
20
-     * @param callable $isEqual Equality relation with signature function($a, $b) : bool
21
-     */
22
-    public function __construct(callable $isEqual) {
23
-        $this->isEqual = $isEqual;
24
-    }
25
-
26
-    /**
27
-     * Calculate diff (edit script) from $old to $new.
28
-     *
29
-     * @param array $old Original array
30
-     * @param array $new New array
31
-     *
32
-     * @return DiffElem[] Diff (edit script)
33
-     */
34
-    public function diff(array $old, array $new) {
35
-        list($trace, $x, $y) = $this->calculateTrace($old, $new);
36
-        return $this->extractDiff($trace, $x, $y, $old, $new);
37
-    }
38
-
39
-    /**
40
-     * Calculate diff, including "replace" operations.
41
-     *
42
-     * If a sequence of remove operations is followed by the same number of add operations, these
43
-     * will be coalesced into replace operations.
44
-     *
45
-     * @param array $old Original array
46
-     * @param array $new New array
47
-     *
48
-     * @return DiffElem[] Diff (edit script), including replace operations
49
-     */
50
-    public function diffWithReplacements(array $old, array $new) {
51
-        return $this->coalesceReplacements($this->diff($old, $new));
52
-    }
53
-
54
-    private function calculateTrace(array $a, array $b) {
55
-        $n = \count($a);
56
-        $m = \count($b);
57
-        $max = $n + $m;
58
-        $v = [1 => 0];
59
-        $trace = [];
60
-        for ($d = 0; $d <= $max; $d++) {
61
-            $trace[] = $v;
62
-            for ($k = -$d; $k <= $d; $k += 2) {
63
-                if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) {
64
-                    $x = $v[$k+1];
65
-                } else {
66
-                    $x = $v[$k-1] + 1;
67
-                }
68
-
69
-                $y = $x - $k;
70
-                while ($x < $n && $y < $m && ($this->isEqual)($a[$x], $b[$y])) {
71
-                    $x++;
72
-                    $y++;
73
-                }
74
-
75
-                $v[$k] = $x;
76
-                if ($x >= $n && $y >= $m) {
77
-                    return [$trace, $x, $y];
78
-                }
79
-            }
80
-        }
81
-        throw new \Exception('Should not happen');
82
-    }
83
-
84
-    private function extractDiff(array $trace, int $x, int $y, array $a, array $b) {
85
-        $result = [];
86
-        for ($d = \count($trace) - 1; $d >= 0; $d--) {
87
-            $v = $trace[$d];
88
-            $k = $x - $y;
89
-
90
-            if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) {
91
-                $prevK = $k + 1;
92
-            } else {
93
-                $prevK = $k - 1;
94
-            }
95
-
96
-            $prevX = $v[$prevK];
97
-            $prevY = $prevX - $prevK;
98
-
99
-            while ($x > $prevX && $y > $prevY) {
100
-                $result[] = new DiffElem(DiffElem::TYPE_KEEP, $a[$x-1], $b[$y-1]);
101
-                $x--;
102
-                $y--;
103
-            }
104
-
105
-            if ($d === 0) {
106
-                break;
107
-            }
108
-
109
-            while ($x > $prevX) {
110
-                $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $a[$x-1], null);
111
-                $x--;
112
-            }
113
-
114
-            while ($y > $prevY) {
115
-                $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $b[$y-1]);
116
-                $y--;
117
-            }
118
-        }
119
-        return array_reverse($result);
120
-    }
121
-
122
-    /**
123
-     * Coalesce equal-length sequences of remove+add into a replace operation.
124
-     *
125
-     * @param DiffElem[] $diff
126
-     * @return DiffElem[]
127
-     */
128
-    private function coalesceReplacements(array $diff) {
129
-        $newDiff = [];
130
-        $c = \count($diff);
131
-        for ($i = 0; $i < $c; $i++) {
132
-            $diffType = $diff[$i]->type;
133
-            if ($diffType !== DiffElem::TYPE_REMOVE) {
134
-                $newDiff[] = $diff[$i];
135
-                continue;
136
-            }
137
-
138
-            $j = $i;
139
-            while ($j < $c && $diff[$j]->type === DiffElem::TYPE_REMOVE) {
140
-                $j++;
141
-            }
142
-
143
-            $k = $j;
144
-            while ($k < $c && $diff[$k]->type === DiffElem::TYPE_ADD) {
145
-                $k++;
146
-            }
147
-
148
-            if ($j - $i === $k - $j) {
149
-                $len = $j - $i;
150
-                for ($n = 0; $n < $len; $n++) {
151
-                    $newDiff[] = new DiffElem(
152
-                        DiffElem::TYPE_REPLACE, $diff[$i + $n]->old, $diff[$j + $n]->new
153
-                    );
154
-                }
155
-            } else {
156
-                for (; $i < $k; $i++) {
157
-                    $newDiff[] = $diff[$i];
158
-                }
159
-            }
160
-            $i = $k - 1;
161
-        }
162
-        return $newDiff;
163
-    }
15
+	private $isEqual;
16
+
17
+	/**
18
+	 * Create differ over the given equality relation.
19
+	 *
20
+	 * @param callable $isEqual Equality relation with signature function($a, $b) : bool
21
+	 */
22
+	public function __construct(callable $isEqual) {
23
+		$this->isEqual = $isEqual;
24
+	}
25
+
26
+	/**
27
+	 * Calculate diff (edit script) from $old to $new.
28
+	 *
29
+	 * @param array $old Original array
30
+	 * @param array $new New array
31
+	 *
32
+	 * @return DiffElem[] Diff (edit script)
33
+	 */
34
+	public function diff(array $old, array $new) {
35
+		list($trace, $x, $y) = $this->calculateTrace($old, $new);
36
+		return $this->extractDiff($trace, $x, $y, $old, $new);
37
+	}
38
+
39
+	/**
40
+	 * Calculate diff, including "replace" operations.
41
+	 *
42
+	 * If a sequence of remove operations is followed by the same number of add operations, these
43
+	 * will be coalesced into replace operations.
44
+	 *
45
+	 * @param array $old Original array
46
+	 * @param array $new New array
47
+	 *
48
+	 * @return DiffElem[] Diff (edit script), including replace operations
49
+	 */
50
+	public function diffWithReplacements(array $old, array $new) {
51
+		return $this->coalesceReplacements($this->diff($old, $new));
52
+	}
53
+
54
+	private function calculateTrace(array $a, array $b) {
55
+		$n = \count($a);
56
+		$m = \count($b);
57
+		$max = $n + $m;
58
+		$v = [1 => 0];
59
+		$trace = [];
60
+		for ($d = 0; $d <= $max; $d++) {
61
+			$trace[] = $v;
62
+			for ($k = -$d; $k <= $d; $k += 2) {
63
+				if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) {
64
+					$x = $v[$k+1];
65
+				} else {
66
+					$x = $v[$k-1] + 1;
67
+				}
68
+
69
+				$y = $x - $k;
70
+				while ($x < $n && $y < $m && ($this->isEqual)($a[$x], $b[$y])) {
71
+					$x++;
72
+					$y++;
73
+				}
74
+
75
+				$v[$k] = $x;
76
+				if ($x >= $n && $y >= $m) {
77
+					return [$trace, $x, $y];
78
+				}
79
+			}
80
+		}
81
+		throw new \Exception('Should not happen');
82
+	}
83
+
84
+	private function extractDiff(array $trace, int $x, int $y, array $a, array $b) {
85
+		$result = [];
86
+		for ($d = \count($trace) - 1; $d >= 0; $d--) {
87
+			$v = $trace[$d];
88
+			$k = $x - $y;
89
+
90
+			if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) {
91
+				$prevK = $k + 1;
92
+			} else {
93
+				$prevK = $k - 1;
94
+			}
95
+
96
+			$prevX = $v[$prevK];
97
+			$prevY = $prevX - $prevK;
98
+
99
+			while ($x > $prevX && $y > $prevY) {
100
+				$result[] = new DiffElem(DiffElem::TYPE_KEEP, $a[$x-1], $b[$y-1]);
101
+				$x--;
102
+				$y--;
103
+			}
104
+
105
+			if ($d === 0) {
106
+				break;
107
+			}
108
+
109
+			while ($x > $prevX) {
110
+				$result[] = new DiffElem(DiffElem::TYPE_REMOVE, $a[$x-1], null);
111
+				$x--;
112
+			}
113
+
114
+			while ($y > $prevY) {
115
+				$result[] = new DiffElem(DiffElem::TYPE_ADD, null, $b[$y-1]);
116
+				$y--;
117
+			}
118
+		}
119
+		return array_reverse($result);
120
+	}
121
+
122
+	/**
123
+	 * Coalesce equal-length sequences of remove+add into a replace operation.
124
+	 *
125
+	 * @param DiffElem[] $diff
126
+	 * @return DiffElem[]
127
+	 */
128
+	private function coalesceReplacements(array $diff) {
129
+		$newDiff = [];
130
+		$c = \count($diff);
131
+		for ($i = 0; $i < $c; $i++) {
132
+			$diffType = $diff[$i]->type;
133
+			if ($diffType !== DiffElem::TYPE_REMOVE) {
134
+				$newDiff[] = $diff[$i];
135
+				continue;
136
+			}
137
+
138
+			$j = $i;
139
+			while ($j < $c && $diff[$j]->type === DiffElem::TYPE_REMOVE) {
140
+				$j++;
141
+			}
142
+
143
+			$k = $j;
144
+			while ($k < $c && $diff[$k]->type === DiffElem::TYPE_ADD) {
145
+				$k++;
146
+			}
147
+
148
+			if ($j - $i === $k - $j) {
149
+				$len = $j - $i;
150
+				for ($n = 0; $n < $len; $n++) {
151
+					$newDiff[] = new DiffElem(
152
+						DiffElem::TYPE_REPLACE, $diff[$i + $n]->old, $diff[$j + $n]->new
153
+					);
154
+				}
155
+			} else {
156
+				for (; $i < $k; $i++) {
157
+					$newDiff[] = $diff[$i];
158
+				}
159
+			}
160
+			$i = $k - 1;
161
+		}
162
+		return $newDiff;
163
+	}
164 164
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
         for ($d = 0; $d <= $max; $d++) {
61 61
             $trace[] = $v;
62 62
             for ($k = -$d; $k <= $d; $k += 2) {
63
-                if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) {
64
-                    $x = $v[$k+1];
63
+                if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) {
64
+                    $x = $v[$k + 1];
65 65
                 } else {
66
-                    $x = $v[$k-1] + 1;
66
+                    $x = $v[$k - 1] + 1;
67 67
                 }
68 68
 
69 69
                 $y = $x - $k;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
             $v = $trace[$d];
88 88
             $k = $x - $y;
89 89
 
90
-            if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) {
90
+            if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) {
91 91
                 $prevK = $k + 1;
92 92
             } else {
93 93
                 $prevK = $k - 1;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             $prevY = $prevX - $prevK;
98 98
 
99 99
             while ($x > $prevX && $y > $prevY) {
100
-                $result[] = new DiffElem(DiffElem::TYPE_KEEP, $a[$x-1], $b[$y-1]);
100
+                $result[] = new DiffElem(DiffElem::TYPE_KEEP, $a[$x - 1], $b[$y - 1]);
101 101
                 $x--;
102 102
                 $y--;
103 103
             }
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
             }
108 108
 
109 109
             while ($x > $prevX) {
110
-                $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $a[$x-1], null);
110
+                $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $a[$x - 1], null);
111 111
                 $x--;
112 112
             }
113 113
 
114 114
             while ($y > $prevY) {
115
-                $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $b[$y-1]);
115
+                $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $b[$y - 1]);
116 116
                 $y--;
117 117
             }
118 118
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@
 block discarded – undo
10 10
  *
11 11
  * @internal
12 12
  */
13
-class Differ
14
-{
13
+class Differ {
15 14
     private $isEqual;
16 15
 
17 16
     /**
Please login to merge, or discard this patch.
nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php 2 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -17,48 +17,48 @@
 block discarded – undo
17 17
  */
18 18
 class PrintableNewAnonClassNode extends Expr
19 19
 {
20
-    /** @var Node\AttributeGroup[] PHP attribute groups */
21
-    public $attrGroups;
22
-    /** @var int Modifiers */
23
-    public $flags;
24
-    /** @var Node\Arg[] Arguments */
25
-    public $args;
26
-    /** @var null|Node\Name Name of extended class */
27
-    public $extends;
28
-    /** @var Node\Name[] Names of implemented interfaces */
29
-    public $implements;
30
-    /** @var Node\Stmt[] Statements */
31
-    public $stmts;
20
+	/** @var Node\AttributeGroup[] PHP attribute groups */
21
+	public $attrGroups;
22
+	/** @var int Modifiers */
23
+	public $flags;
24
+	/** @var Node\Arg[] Arguments */
25
+	public $args;
26
+	/** @var null|Node\Name Name of extended class */
27
+	public $extends;
28
+	/** @var Node\Name[] Names of implemented interfaces */
29
+	public $implements;
30
+	/** @var Node\Stmt[] Statements */
31
+	public $stmts;
32 32
 
33
-    public function __construct(
34
-        array $attrGroups, int $flags, array $args, ?Node\Name $extends, array $implements,
35
-        array $stmts, array $attributes
36
-    ) {
37
-        parent::__construct($attributes);
38
-        $this->attrGroups = $attrGroups;
39
-        $this->flags = $flags;
40
-        $this->args = $args;
41
-        $this->extends = $extends;
42
-        $this->implements = $implements;
43
-        $this->stmts = $stmts;
44
-    }
33
+	public function __construct(
34
+		array $attrGroups, int $flags, array $args, ?Node\Name $extends, array $implements,
35
+		array $stmts, array $attributes
36
+	) {
37
+		parent::__construct($attributes);
38
+		$this->attrGroups = $attrGroups;
39
+		$this->flags = $flags;
40
+		$this->args = $args;
41
+		$this->extends = $extends;
42
+		$this->implements = $implements;
43
+		$this->stmts = $stmts;
44
+	}
45 45
 
46
-    public static function fromNewNode(Expr\New_ $newNode) {
47
-        $class = $newNode->class;
48
-        assert($class instanceof Node\Stmt\Class_);
49
-        // We don't assert that $class->name is null here, to allow consumers to assign unique names
50
-        // to anonymous classes for their own purposes. We simplify ignore the name here.
51
-        return new self(
52
-            $class->attrGroups, $class->flags, $newNode->args, $class->extends, $class->implements,
53
-            $class->stmts, $newNode->getAttributes()
54
-        );
55
-    }
46
+	public static function fromNewNode(Expr\New_ $newNode) {
47
+		$class = $newNode->class;
48
+		assert($class instanceof Node\Stmt\Class_);
49
+		// We don't assert that $class->name is null here, to allow consumers to assign unique names
50
+		// to anonymous classes for their own purposes. We simplify ignore the name here.
51
+		return new self(
52
+			$class->attrGroups, $class->flags, $newNode->args, $class->extends, $class->implements,
53
+			$class->stmts, $newNode->getAttributes()
54
+		);
55
+	}
56 56
 
57
-    public function getType() : string {
58
-        return 'Expr_PrintableNewAnonClass';
59
-    }
57
+	public function getType() : string {
58
+		return 'Expr_PrintableNewAnonClass';
59
+	}
60 60
 
61
-    public function getSubNodeNames() : array {
62
-        return ['attrGroups', 'flags', 'args', 'extends', 'implements', 'stmts'];
63
-    }
61
+	public function getSubNodeNames() : array {
62
+		return ['attrGroups', 'flags', 'args', 'extends', 'implements', 'stmts'];
63
+	}
64 64
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@
 block discarded – undo
15 15
  *
16 16
  * @internal
17 17
  */
18
-class PrintableNewAnonClassNode extends Expr
19
-{
18
+class PrintableNewAnonClassNode extends Expr {
20 19
     /** @var Node\AttributeGroup[] PHP attribute groups */
21 20
     public $attrGroups;
22 21
     /** @var int Modifiers */
Please login to merge, or discard this patch.
php-scoper/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php 3 patches
Indentation   +249 added lines, -249 removed lines patch added patch discarded remove patch
@@ -9,278 +9,278 @@
 block discarded – undo
9 9
  */
10 10
 class TokenStream
11 11
 {
12
-    /** @var array Tokens (in token_get_all format) */
13
-    private $tokens;
14
-    /** @var int[] Map from position to indentation */
15
-    private $indentMap;
12
+	/** @var array Tokens (in token_get_all format) */
13
+	private $tokens;
14
+	/** @var int[] Map from position to indentation */
15
+	private $indentMap;
16 16
 
17
-    /**
18
-     * Create token stream instance.
19
-     *
20
-     * @param array $tokens Tokens in token_get_all() format
21
-     */
22
-    public function __construct(array $tokens) {
23
-        $this->tokens = $tokens;
24
-        $this->indentMap = $this->calcIndentMap();
25
-    }
17
+	/**
18
+	 * Create token stream instance.
19
+	 *
20
+	 * @param array $tokens Tokens in token_get_all() format
21
+	 */
22
+	public function __construct(array $tokens) {
23
+		$this->tokens = $tokens;
24
+		$this->indentMap = $this->calcIndentMap();
25
+	}
26 26
 
27
-    /**
28
-     * Whether the given position is immediately surrounded by parenthesis.
29
-     *
30
-     * @param int $startPos Start position
31
-     * @param int $endPos   End position
32
-     *
33
-     * @return bool
34
-     */
35
-    public function haveParens(int $startPos, int $endPos) : bool {
36
-        return $this->haveTokenImmediatelyBefore($startPos, '(')
37
-            && $this->haveTokenImmediatelyAfter($endPos, ')');
38
-    }
27
+	/**
28
+	 * Whether the given position is immediately surrounded by parenthesis.
29
+	 *
30
+	 * @param int $startPos Start position
31
+	 * @param int $endPos   End position
32
+	 *
33
+	 * @return bool
34
+	 */
35
+	public function haveParens(int $startPos, int $endPos) : bool {
36
+		return $this->haveTokenImmediatelyBefore($startPos, '(')
37
+			&& $this->haveTokenImmediatelyAfter($endPos, ')');
38
+	}
39 39
 
40
-    /**
41
-     * Whether the given position is immediately surrounded by braces.
42
-     *
43
-     * @param int $startPos Start position
44
-     * @param int $endPos   End position
45
-     *
46
-     * @return bool
47
-     */
48
-    public function haveBraces(int $startPos, int $endPos) : bool {
49
-        return ($this->haveTokenImmediatelyBefore($startPos, '{')
50
-                || $this->haveTokenImmediatelyBefore($startPos, T_CURLY_OPEN))
51
-            && $this->haveTokenImmediatelyAfter($endPos, '}');
52
-    }
40
+	/**
41
+	 * Whether the given position is immediately surrounded by braces.
42
+	 *
43
+	 * @param int $startPos Start position
44
+	 * @param int $endPos   End position
45
+	 *
46
+	 * @return bool
47
+	 */
48
+	public function haveBraces(int $startPos, int $endPos) : bool {
49
+		return ($this->haveTokenImmediatelyBefore($startPos, '{')
50
+				|| $this->haveTokenImmediatelyBefore($startPos, T_CURLY_OPEN))
51
+			&& $this->haveTokenImmediatelyAfter($endPos, '}');
52
+	}
53 53
 
54
-    /**
55
-     * Check whether the position is directly preceded by a certain token type.
56
-     *
57
-     * During this check whitespace and comments are skipped.
58
-     *
59
-     * @param int        $pos               Position before which the token should occur
60
-     * @param int|string $expectedTokenType Token to check for
61
-     *
62
-     * @return bool Whether the expected token was found
63
-     */
64
-    public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType) : bool {
65
-        $tokens = $this->tokens;
66
-        $pos--;
67
-        for (; $pos >= 0; $pos--) {
68
-            $tokenType = $tokens[$pos][0];
69
-            if ($tokenType === $expectedTokenType) {
70
-                return true;
71
-            }
72
-            if ($tokenType !== \T_WHITESPACE
73
-                && $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) {
74
-                break;
75
-            }
76
-        }
77
-        return false;
78
-    }
54
+	/**
55
+	 * Check whether the position is directly preceded by a certain token type.
56
+	 *
57
+	 * During this check whitespace and comments are skipped.
58
+	 *
59
+	 * @param int        $pos               Position before which the token should occur
60
+	 * @param int|string $expectedTokenType Token to check for
61
+	 *
62
+	 * @return bool Whether the expected token was found
63
+	 */
64
+	public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType) : bool {
65
+		$tokens = $this->tokens;
66
+		$pos--;
67
+		for (; $pos >= 0; $pos--) {
68
+			$tokenType = $tokens[$pos][0];
69
+			if ($tokenType === $expectedTokenType) {
70
+				return true;
71
+			}
72
+			if ($tokenType !== \T_WHITESPACE
73
+				&& $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) {
74
+				break;
75
+			}
76
+		}
77
+		return false;
78
+	}
79 79
 
80
-    /**
81
-     * Check whether the position is directly followed by a certain token type.
82
-     *
83
-     * During this check whitespace and comments are skipped.
84
-     *
85
-     * @param int        $pos               Position after which the token should occur
86
-     * @param int|string $expectedTokenType Token to check for
87
-     *
88
-     * @return bool Whether the expected token was found
89
-     */
90
-    public function haveTokenImmediatelyAfter(int $pos, $expectedTokenType) : bool {
91
-        $tokens = $this->tokens;
92
-        $pos++;
93
-        for (; $pos < \count($tokens); $pos++) {
94
-            $tokenType = $tokens[$pos][0];
95
-            if ($tokenType === $expectedTokenType) {
96
-                return true;
97
-            }
98
-            if ($tokenType !== \T_WHITESPACE
99
-                && $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) {
100
-                break;
101
-            }
102
-        }
103
-        return false;
104
-    }
80
+	/**
81
+	 * Check whether the position is directly followed by a certain token type.
82
+	 *
83
+	 * During this check whitespace and comments are skipped.
84
+	 *
85
+	 * @param int        $pos               Position after which the token should occur
86
+	 * @param int|string $expectedTokenType Token to check for
87
+	 *
88
+	 * @return bool Whether the expected token was found
89
+	 */
90
+	public function haveTokenImmediatelyAfter(int $pos, $expectedTokenType) : bool {
91
+		$tokens = $this->tokens;
92
+		$pos++;
93
+		for (; $pos < \count($tokens); $pos++) {
94
+			$tokenType = $tokens[$pos][0];
95
+			if ($tokenType === $expectedTokenType) {
96
+				return true;
97
+			}
98
+			if ($tokenType !== \T_WHITESPACE
99
+				&& $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) {
100
+				break;
101
+			}
102
+		}
103
+		return false;
104
+	}
105 105
 
106
-    public function skipLeft(int $pos, $skipTokenType) {
107
-        $tokens = $this->tokens;
106
+	public function skipLeft(int $pos, $skipTokenType) {
107
+		$tokens = $this->tokens;
108 108
 
109
-        $pos = $this->skipLeftWhitespace($pos);
110
-        if ($skipTokenType === \T_WHITESPACE) {
111
-            return $pos;
112
-        }
109
+		$pos = $this->skipLeftWhitespace($pos);
110
+		if ($skipTokenType === \T_WHITESPACE) {
111
+			return $pos;
112
+		}
113 113
 
114
-        if ($tokens[$pos][0] !== $skipTokenType) {
115
-            // Shouldn't happen. The skip token MUST be there
116
-            throw new \Exception('Encountered unexpected token');
117
-        }
118
-        $pos--;
114
+		if ($tokens[$pos][0] !== $skipTokenType) {
115
+			// Shouldn't happen. The skip token MUST be there
116
+			throw new \Exception('Encountered unexpected token');
117
+		}
118
+		$pos--;
119 119
 
120
-        return $this->skipLeftWhitespace($pos);
121
-    }
120
+		return $this->skipLeftWhitespace($pos);
121
+	}
122 122
 
123
-    public function skipRight(int $pos, $skipTokenType) {
124
-        $tokens = $this->tokens;
123
+	public function skipRight(int $pos, $skipTokenType) {
124
+		$tokens = $this->tokens;
125 125
 
126
-        $pos = $this->skipRightWhitespace($pos);
127
-        if ($skipTokenType === \T_WHITESPACE) {
128
-            return $pos;
129
-        }
126
+		$pos = $this->skipRightWhitespace($pos);
127
+		if ($skipTokenType === \T_WHITESPACE) {
128
+			return $pos;
129
+		}
130 130
 
131
-        if ($tokens[$pos][0] !== $skipTokenType) {
132
-            // Shouldn't happen. The skip token MUST be there
133
-            throw new \Exception('Encountered unexpected token');
134
-        }
135
-        $pos++;
131
+		if ($tokens[$pos][0] !== $skipTokenType) {
132
+			// Shouldn't happen. The skip token MUST be there
133
+			throw new \Exception('Encountered unexpected token');
134
+		}
135
+		$pos++;
136 136
 
137
-        return $this->skipRightWhitespace($pos);
138
-    }
137
+		return $this->skipRightWhitespace($pos);
138
+	}
139 139
 
140
-    /**
141
-     * Return first non-whitespace token position smaller or equal to passed position.
142
-     *
143
-     * @param int $pos Token position
144
-     * @return int Non-whitespace token position
145
-     */
146
-    public function skipLeftWhitespace(int $pos) {
147
-        $tokens = $this->tokens;
148
-        for (; $pos >= 0; $pos--) {
149
-            $type = $tokens[$pos][0];
150
-            if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) {
151
-                break;
152
-            }
153
-        }
154
-        return $pos;
155
-    }
140
+	/**
141
+	 * Return first non-whitespace token position smaller or equal to passed position.
142
+	 *
143
+	 * @param int $pos Token position
144
+	 * @return int Non-whitespace token position
145
+	 */
146
+	public function skipLeftWhitespace(int $pos) {
147
+		$tokens = $this->tokens;
148
+		for (; $pos >= 0; $pos--) {
149
+			$type = $tokens[$pos][0];
150
+			if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) {
151
+				break;
152
+			}
153
+		}
154
+		return $pos;
155
+	}
156 156
 
157
-    /**
158
-     * Return first non-whitespace position greater or equal to passed position.
159
-     *
160
-     * @param int $pos Token position
161
-     * @return int Non-whitespace token position
162
-     */
163
-    public function skipRightWhitespace(int $pos) {
164
-        $tokens = $this->tokens;
165
-        for ($count = \count($tokens); $pos < $count; $pos++) {
166
-            $type = $tokens[$pos][0];
167
-            if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) {
168
-                break;
169
-            }
170
-        }
171
-        return $pos;
172
-    }
157
+	/**
158
+	 * Return first non-whitespace position greater or equal to passed position.
159
+	 *
160
+	 * @param int $pos Token position
161
+	 * @return int Non-whitespace token position
162
+	 */
163
+	public function skipRightWhitespace(int $pos) {
164
+		$tokens = $this->tokens;
165
+		for ($count = \count($tokens); $pos < $count; $pos++) {
166
+			$type = $tokens[$pos][0];
167
+			if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) {
168
+				break;
169
+			}
170
+		}
171
+		return $pos;
172
+	}
173 173
 
174
-    public function findRight(int $pos, $findTokenType) {
175
-        $tokens = $this->tokens;
176
-        for ($count = \count($tokens); $pos < $count; $pos++) {
177
-            $type = $tokens[$pos][0];
178
-            if ($type === $findTokenType) {
179
-                return $pos;
180
-            }
181
-        }
182
-        return -1;
183
-    }
174
+	public function findRight(int $pos, $findTokenType) {
175
+		$tokens = $this->tokens;
176
+		for ($count = \count($tokens); $pos < $count; $pos++) {
177
+			$type = $tokens[$pos][0];
178
+			if ($type === $findTokenType) {
179
+				return $pos;
180
+			}
181
+		}
182
+		return -1;
183
+	}
184 184
 
185
-    /**
186
-     * Whether the given position range contains a certain token type.
187
-     *
188
-     * @param int $startPos Starting position (inclusive)
189
-     * @param int $endPos Ending position (exclusive)
190
-     * @param int|string $tokenType Token type to look for
191
-     * @return bool Whether the token occurs in the given range
192
-     */
193
-    public function haveTokenInRange(int $startPos, int $endPos, $tokenType) {
194
-        $tokens = $this->tokens;
195
-        for ($pos = $startPos; $pos < $endPos; $pos++) {
196
-            if ($tokens[$pos][0] === $tokenType) {
197
-                return true;
198
-            }
199
-        }
200
-        return false;
201
-    }
185
+	/**
186
+	 * Whether the given position range contains a certain token type.
187
+	 *
188
+	 * @param int $startPos Starting position (inclusive)
189
+	 * @param int $endPos Ending position (exclusive)
190
+	 * @param int|string $tokenType Token type to look for
191
+	 * @return bool Whether the token occurs in the given range
192
+	 */
193
+	public function haveTokenInRange(int $startPos, int $endPos, $tokenType) {
194
+		$tokens = $this->tokens;
195
+		for ($pos = $startPos; $pos < $endPos; $pos++) {
196
+			if ($tokens[$pos][0] === $tokenType) {
197
+				return true;
198
+			}
199
+		}
200
+		return false;
201
+	}
202 202
 
203
-    public function haveBracesInRange(int $startPos, int $endPos) {
204
-        return $this->haveTokenInRange($startPos, $endPos, '{')
205
-            || $this->haveTokenInRange($startPos, $endPos, T_CURLY_OPEN)
206
-            || $this->haveTokenInRange($startPos, $endPos, '}');
207
-    }
203
+	public function haveBracesInRange(int $startPos, int $endPos) {
204
+		return $this->haveTokenInRange($startPos, $endPos, '{')
205
+			|| $this->haveTokenInRange($startPos, $endPos, T_CURLY_OPEN)
206
+			|| $this->haveTokenInRange($startPos, $endPos, '}');
207
+	}
208 208
 
209
-    public function haveTagInRange(int $startPos, int $endPos): bool {
210
-        return $this->haveTokenInRange($startPos, $endPos, \T_OPEN_TAG)
211
-            || $this->haveTokenInRange($startPos, $endPos, \T_CLOSE_TAG);
212
-    }
209
+	public function haveTagInRange(int $startPos, int $endPos): bool {
210
+		return $this->haveTokenInRange($startPos, $endPos, \T_OPEN_TAG)
211
+			|| $this->haveTokenInRange($startPos, $endPos, \T_CLOSE_TAG);
212
+	}
213 213
 
214
-    /**
215
-     * Get indentation before token position.
216
-     *
217
-     * @param int $pos Token position
218
-     *
219
-     * @return int Indentation depth (in spaces)
220
-     */
221
-    public function getIndentationBefore(int $pos) : int {
222
-        return $this->indentMap[$pos];
223
-    }
214
+	/**
215
+	 * Get indentation before token position.
216
+	 *
217
+	 * @param int $pos Token position
218
+	 *
219
+	 * @return int Indentation depth (in spaces)
220
+	 */
221
+	public function getIndentationBefore(int $pos) : int {
222
+		return $this->indentMap[$pos];
223
+	}
224 224
 
225
-    /**
226
-     * Get the code corresponding to a token offset range, optionally adjusted for indentation.
227
-     *
228
-     * @param int $from   Token start position (inclusive)
229
-     * @param int $to     Token end position (exclusive)
230
-     * @param int $indent By how much the code should be indented (can be negative as well)
231
-     *
232
-     * @return string Code corresponding to token range, adjusted for indentation
233
-     */
234
-    public function getTokenCode(int $from, int $to, int $indent) : string {
235
-        $tokens = $this->tokens;
236
-        $result = '';
237
-        for ($pos = $from; $pos < $to; $pos++) {
238
-            $token = $tokens[$pos];
239
-            if (\is_array($token)) {
240
-                $type = $token[0];
241
-                $content = $token[1];
242
-                if ($type === \T_CONSTANT_ENCAPSED_STRING || $type === \T_ENCAPSED_AND_WHITESPACE) {
243
-                    $result .= $content;
244
-                } else {
245
-                    // TODO Handle non-space indentation
246
-                    if ($indent < 0) {
247
-                        $result .= str_replace("\n" . str_repeat(" ", -$indent), "\n", $content);
248
-                    } elseif ($indent > 0) {
249
-                        $result .= str_replace("\n", "\n" . str_repeat(" ", $indent), $content);
250
-                    } else {
251
-                        $result .= $content;
252
-                    }
253
-                }
254
-            } else {
255
-                $result .= $token;
256
-            }
257
-        }
258
-        return $result;
259
-    }
225
+	/**
226
+	 * Get the code corresponding to a token offset range, optionally adjusted for indentation.
227
+	 *
228
+	 * @param int $from   Token start position (inclusive)
229
+	 * @param int $to     Token end position (exclusive)
230
+	 * @param int $indent By how much the code should be indented (can be negative as well)
231
+	 *
232
+	 * @return string Code corresponding to token range, adjusted for indentation
233
+	 */
234
+	public function getTokenCode(int $from, int $to, int $indent) : string {
235
+		$tokens = $this->tokens;
236
+		$result = '';
237
+		for ($pos = $from; $pos < $to; $pos++) {
238
+			$token = $tokens[$pos];
239
+			if (\is_array($token)) {
240
+				$type = $token[0];
241
+				$content = $token[1];
242
+				if ($type === \T_CONSTANT_ENCAPSED_STRING || $type === \T_ENCAPSED_AND_WHITESPACE) {
243
+					$result .= $content;
244
+				} else {
245
+					// TODO Handle non-space indentation
246
+					if ($indent < 0) {
247
+						$result .= str_replace("\n" . str_repeat(" ", -$indent), "\n", $content);
248
+					} elseif ($indent > 0) {
249
+						$result .= str_replace("\n", "\n" . str_repeat(" ", $indent), $content);
250
+					} else {
251
+						$result .= $content;
252
+					}
253
+				}
254
+			} else {
255
+				$result .= $token;
256
+			}
257
+		}
258
+		return $result;
259
+	}
260 260
 
261
-    /**
262
-     * Precalculate the indentation at every token position.
263
-     *
264
-     * @return int[] Token position to indentation map
265
-     */
266
-    private function calcIndentMap() {
267
-        $indentMap = [];
268
-        $indent = 0;
269
-        foreach ($this->tokens as $token) {
270
-            $indentMap[] = $indent;
261
+	/**
262
+	 * Precalculate the indentation at every token position.
263
+	 *
264
+	 * @return int[] Token position to indentation map
265
+	 */
266
+	private function calcIndentMap() {
267
+		$indentMap = [];
268
+		$indent = 0;
269
+		foreach ($this->tokens as $token) {
270
+			$indentMap[] = $indent;
271 271
 
272
-            if ($token[0] === \T_WHITESPACE) {
273
-                $content = $token[1];
274
-                $newlinePos = \strrpos($content, "\n");
275
-                if (false !== $newlinePos) {
276
-                    $indent = \strlen($content) - $newlinePos - 1;
277
-                }
278
-            }
279
-        }
272
+			if ($token[0] === \T_WHITESPACE) {
273
+				$content = $token[1];
274
+				$newlinePos = \strrpos($content, "\n");
275
+				if (false !== $newlinePos) {
276
+					$indent = \strlen($content) - $newlinePos - 1;
277
+				}
278
+			}
279
+		}
280 280
 
281
-        // Add a sentinel for one past end of the file
282
-        $indentMap[] = $indent;
281
+		// Add a sentinel for one past end of the file
282
+		$indentMap[] = $indent;
283 283
 
284
-        return $indentMap;
285
-    }
284
+		return $indentMap;
285
+	}
286 286
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -244,9 +244,9 @@
 block discarded – undo
244 244
                 } else {
245 245
                     // TODO Handle non-space indentation
246 246
                     if ($indent < 0) {
247
-                        $result .= str_replace("\n" . str_repeat(" ", -$indent), "\n", $content);
247
+                        $result .= str_replace("\n".str_repeat(" ", -$indent), "\n", $content);
248 248
                     } elseif ($indent > 0) {
249
-                        $result .= str_replace("\n", "\n" . str_repeat(" ", $indent), $content);
249
+                        $result .= str_replace("\n", "\n".str_repeat(" ", $indent), $content);
250 250
                     } else {
251 251
                         $result .= $content;
252 252
                     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@
 block discarded – undo
7 7
  *
8 8
  * @internal
9 9
  */
10
-class TokenStream
11
-{
10
+class TokenStream {
12 11
     /** @var array Tokens (in token_get_all format) */
13 12
     private $tokens;
14 13
     /** @var int[] Map from position to indentation */
Please login to merge, or discard this patch.