-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy path.scoper.inc.php
56 lines (50 loc) · 1.59 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
<?php
declare( strict_types=1 );
use Isolated\Symfony\Component\Finder\Finder;
return [
// The prefix configuration. If a non null value will be used, a random prefix will be generated.
'prefix' => 'PluginName\\Vendor',
'whitelist-global-constants' => false,
'whitelist-global-classes' => false,
'whitelist-global-functions' => false,
/**
* By default when running php-scoper add-prefix, it will prefix all relevant code found in the current working
* directory. You can however define which files should be scoped by defining a collection of Finders in the
* following configuration key.
*
* For more see: https://github.com/humbug/php-scoper#finders-and-paths.
*/
'finders' => [
Finder::create()->
files()->
in(
[
'vendor/rdlowrey/auryn/lib',
]
)->
exclude(
[
'test',
'examples',
]
)->
name( [ '*.php' ] ),
],
/** 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#patchers.
*/
'patchers' => [
function ( string $file_path, string $prefix, string $contents ): string {
// Change the contents here.
return str_replace(
'Auryn\\\\',
sprintf( '%s\\\\Auryn\\\\', addslashes( $prefix ) ),
$contents
);
},
],
];