1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | use Isolated\Symfony\Component\Finder\Finder; |
||
1 ignored issue
–
show
|
|||
6 | |||
7 | return [ |
||
8 | // By default when running php-scoper add-prefix, it will prefix all relevant code found in the current working |
||
9 | // directory. You can however define which files should be scoped by defining a collection of Finders in the |
||
10 | // following configuration key. |
||
11 | // |
||
12 | // For more see: https://github.com/humbug/php-scoper#finders-and-paths |
||
13 | 'finders' => [ |
||
14 | Finder::create()->files()->in('src'), |
||
15 | Finder::create() |
||
16 | ->files() |
||
17 | ->ignoreVCS(true) |
||
18 | ->notName('/LICENSE|.*\\.md|.*\\.dist|Makefile|composer\\.json|composer\\.lock/') |
||
19 | ->exclude([ |
||
20 | 'doc', |
||
21 | 'test', |
||
22 | 'test_old', |
||
23 | 'tests', |
||
24 | 'Tests', |
||
25 | 'vendor-bin', |
||
26 | ]) |
||
27 | ->in('vendor') |
||
28 | ->in('bin'), |
||
29 | Finder::create()->append([ |
||
30 | 'composer.json', |
||
31 | 'composer.lock', |
||
32 | ]), |
||
33 | ], |
||
34 | |||
35 | // When scoping PHP files, there will be scenarios where some of the code being scoped indirectly references the |
||
36 | // original namespace. These will include, for example, strings or string manipulations. PHP-Scoper has limited |
||
37 | // support for prefixing such strings. To circumvent that, you can define patchers to manipulate the file to your |
||
38 | // heart contents. |
||
39 | // |
||
40 | // For more see: https://github.com/humbug/php-scoper#patchers |
||
41 | 'patchers' => [ |
||
42 | function (string $filePath, string $prefix, string $contents): string { |
||
43 | // Change the contents here. |
||
44 | |||
45 | return $contents; |
||
46 | }, |
||
47 | ], |
||
48 | |||
49 | // PHP-Scoper's goal is to make sure that all code for a project lies in a distinct PHP namespace. However, you |
||
50 | // may want to share a common API between the bundled code of your PHAR and the consumer code. For example if |
||
51 | // you have a PHPUnit PHAR with isolated code, you still want the PHAR to be able to understand the |
||
52 | // PHPUnit\Framework\TestCase class. |
||
53 | // |
||
54 | // A way to achieve this is by specifying a list of classes to not prefix with the following configuration key. Note |
||
55 | // that this does not work with functions or constants neither with classes belonging to the global namespace. |
||
56 | // |
||
57 | // Fore more see https://github.com/humbug/php-scoper#whitelist |
||
58 | 'whitelist' => [ |
||
59 | 'PHPUnit\Framework\TestCase', |
||
60 | ], |
||
61 | ]; |
||
62 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths