-
Notifications
You must be signed in to change notification settings - Fork 1
/
scoper.inc.php
93 lines (84 loc) · 2.72 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
84
85
86
87
88
89
90
91
92
93
<?php
declare( strict_types=1 );
use Isolated\Symfony\Component\Finder\Finder;
// You can do your own things here, e.g. collecting symbols to expose dynamically
// or files to exclude.
// However beware that this file is executed by PHP-Scoper, hence if you are using
// the PHAR it will be loaded by the PHAR. So it is highly recommended to avoid
// to auto-load any code here: it can result in a conflict or even corrupt
// the PHP-Scoper analysis.
return [
// see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#prefix
'prefix' => 'GaCommunicatorVendor',
// For more see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#finders-and-paths
'finders' => [
Finder::create()->files()->in( 'src' ),
Finder::create()
->files()
->ignoreVCS( true )
->notName( '/LICENSE|.*\\.md|.*\\.dist|Makefile|composer\\.json|composer\\.lock/' )
->exclude( [
'doc',
'test',
'test_old',
'tests',
'Tests',
'vendor-bin',
] )
->in( 'vendor' ),
Finder::create()->append( [
'composer.json',
] ),
],
// When scoping PHP files, there will be scenarios where some of the code being scoped indirectly references the
// original namespace. These will include, for example, strings or string manipulations. PHP-Scoper has limited
// support for prefixing such strings. To circumvent that, you can define patchers to manipulate the file to your
// heart contents.
//
// For more see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#patchers
'patchers' => [
static function ( string $filePath, string $prefix, string $contents ): string {
// Change the contents here.
return $contents;
},
],
// For more information see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#excluded-symbols
'exclude-namespaces' => [
'/^cli/',
'/^Composer/',
'/^DeepCopy/',
'/^Doctrine/',
'/^Kunoichi/',
'/^PharIo/',
'/^PHP_CodeSniffer/',
'/^PHPCompatibility/',
'/^PHPCSStandards/',
'/^PHPUnit/',
'/^Yoast/',
'/^SebastianBergmann/',
'/^TheSeer/',
'/^WP_/',
],
'exclude-classes' => [
'/^WP_/',
'/^Composer/',
'/^PHPUnit/',
],
'exclude-functions' => [
// 'mb_str_split',
],
'exclude-constants' => [
// 'STDIN',
],
// List of symbols to expose.
//
// For more information see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposed-symbols
'expose-global-constants' => true,
'expose-global-classes' => false,
'expose-global-functions' => false,
'expose-namespaces' => [
],
'expose-classes' => [],
'expose-functions' => [],
'expose-constants' => [],
];