-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.scoper.inc.php
51 lines (46 loc) · 1.58 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
<?php
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' => 'Emoji\\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/psr/container/',
'vendor/symfony/config/',
'vendor/symfony/filesystem/',
'vendor/symfony/dependency-injection/',
]
)->
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 ( $file_path, $prefix, $contents ) {
// Change the contents here.
return str_replace(
'Symfony\\\\',
sprintf( '%s\\\\Symfony\\\\', addslashes( $prefix ) ),
$contents
);
},
],
];