-
Notifications
You must be signed in to change notification settings - Fork 53
/
scoper.inc.php
83 lines (75 loc) · 2.33 KB
/
scoper.inc.php
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
declare(strict_types=1);
// scoper.inc.php
use Isolated\Symfony\Component\Finder\Finder;
$wp_classes = json_decode(
file_get_contents(
__DIR__.'/vendor/sniccowp/php-scoper-wordpress-excludes/generated/exclude-wordpress-classes.json'
),
true
);
$wp_constants = json_decode(
file_get_contents(
__DIR__.'/vendor/sniccowp/php-scoper-wordpress-excludes/generated/exclude-wordpress-constants.json'
),
true
);
$wp_functions = json_decode(
file_get_contents(
__DIR__.'/vendor/sniccowp/php-scoper-wordpress-excludes/generated/exclude-wordpress-functions.json'
),
true
);
$finders = [
Finder::create()
->files()
->ignoreVCS(true)
->ignoreDotFiles(false) # We need to keep .distignore around
->exclude([
'.github',
'.ddev',
'.idea',
'modules.local',
'tests',
])
->in('.'),
];
return [
'prefix' => 'Mollie', // string|null
'finders' => $finders, // list<Finder>
'patchers' => [], // list<callable(string $filePath, string $prefix, string $contents): string>
'exclude-files' => [
'vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php',
'inc/functions.php',
'inc/utils.php',
'inc/woocommerce.php'
], // list<string>
'exclude-namespaces' => [
'Composer',
'Automattic',
'^WooCommerce',
'Inpsyde\Assets',
'Mollie',
], // list<string|regex>
'exclude-constants' => array_merge($wp_constants, [
'WC_VERSION',
'M4W_FILE',
'M4W_PLUGIN_DIR',
'M4W_PLUGIN_URL'
]), // list<string|regex>
'exclude-classes' => array_merge($wp_classes, [
'WooCommerce',
'/^WC_/',
'\WCS_Retry_Manager'
]), // list<string|regex>
'exclude-functions' => array_merge($wp_functions, [
'/^wc/',
]), // list<string|regex>
'expose-global-constants' => false, // bool
'expose-global-classes' => false, // bool
'expose-global-functions' => false, // bool
'expose-namespaces' => [], // list<string|regex>
'expose-constants' => [], // list<string|regex>
'expose-classes' => [], // list<string|regex>
'expose-functions' => [], // list<string|regex>
];