forked from yffaffy/rollbar
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathscoper.inc.php
More file actions
61 lines (56 loc) · 1.51 KB
/
scoper.inc.php
File metadata and controls
61 lines (56 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
declare(strict_types=1);
require_once './utils/NamespaceTokenFixer.php';
$finder = Isolated\Symfony\Component\Finder\Finder::class;
$fixer = new Rollbar\WordPress\BuildUtils\NamespaceTokenFixer();
return [
'prefix' => 'RollbarWP',
'output-dir' => __DIR__ . '/dist',
'finders' => [
$finder::create()->files()->in('build'),
],
'exclude-namespaces' => [
'Rollbar',
],
'exclude-classes' => [
'WP_REST_Request',
'WP_REST_Response',
'WP_REST_Server',
'WP_HTTP_Proxy',
],
'exclude-functions' => [
'add_action',
'add_filter',
'add_settings_field',
'add_settings_section',
'admin_url',
'checked',
'disabled',
'do_settings_sections',
'esc_attr',
'esc_html',
'esc_url',
'get_admin_url',
'plugin_dir_url',
'register_setting',
'selected',
'settings_fields',
'submit_button',
'wp_enqueue_script',
'wp_enqueue_script',
'wp_enqueue_style',
'wp_localize_script',
'wp_localize_script',
'wp_nonce_field',
'zend_monitor_custom_event',
],
'patchers' => [
static function (string $filePath, string $prefix, string $content) use ($fixer): string {
if ($fixer->fileIsFixable($filePath)) {
$fixer->configure($filePath, $content);
$content = $fixer->fix();
}
return $content;
},
],
];