@@ -25,7 +25,8 @@ Complete configuration reference (details about each entry is available):
25
25
26
26
// scoper.inc.php
27
27
28
- use Isolated\Symfony\Component\Finder\Finder;
28
+ /** @var Symfony\Component\Finder\Finder $finder */
29
+ $finder = Isolated\Symfony\Component\Finder\Finder::class;
29
30
30
31
return [
31
32
'prefix' => null, // string|null
@@ -39,11 +40,11 @@ return [
39
40
'exclude-constants' => [], // list<string |regex >
40
41
'exclude-classes' => [], // list<string |regex >
41
42
'exclude-functions' => [], // list<string |regex >
42
-
43
+
43
44
'expose-global-constants' => true, // bool
44
45
'expose-global-classes' => true, // bool
45
46
'expose-global-functions' => true, // bool
46
-
47
+
47
48
'expose-namespaces' => [], // list<string |regex >
48
49
'expose-constants' => [], // list<string |regex >
49
50
'expose-classes' => [], // list<string |regex >
@@ -60,7 +61,7 @@ then a random prefix will be automatically generated.
60
61
61
62
### PHP Version
62
63
63
- The PHP version provided is used to configure the underlying [ PHP-Parser] Parser and Printer.
64
+ The PHP version provided is used to configure the underlying [ PHP-Parser] Parser and Printer.
64
65
65
66
The version used by the Parser will affect what code it can understand, e.g. if it is configured in PHP 8.2 it will not
66
67
understand a PHP 8.3 construct (e.g. typed class constants). However, what symbols are interpreted as internal will
@@ -95,12 +96,13 @@ files should be scoped by using [Finders][symfony_finder] in the configuration:
95
96
96
97
// scoper.inc.php
97
98
98
- use Isolated\Symfony\Component\Finder\Finder;
99
+ /** @var Symfony\Component\Finder\Finder $finder */
100
+ $finder = Isolated\Symfony\Component\Finder\Finder::class;
99
101
100
102
return [
101
103
'finders' => [
102
- Finder ::create()->files()->in('src'),
103
- Finder ::create()
104
+ $finder ::create()->files()->in('src'),
105
+ $finder ::create()
104
106
->files()
105
107
->ignoreVCS(true)
106
108
->notName('/LICENSE|.*\\.md|.*\\.dist|Makefile|composer\\.json|composer\\.lock/')
@@ -113,7 +115,7 @@ return [
113
115
'vendor-bin',
114
116
])
115
117
->in('vendor'),
116
- Finder ::create()->append([
118
+ $finder ::create()->append([
117
119
'bin/php-scoper',
118
120
'composer.json',
119
121
])
@@ -129,7 +131,7 @@ php-scoper add-prefix file1.php bin/file2.php
129
131
130
132
Paths added manually are appended to the paths found by the finders.
131
133
132
- If you are using [ Box] [ box ] , all the (non-binary) files included are used
134
+ If you are using [ Box] [ box ] , all the (non-binary) files included are used
133
135
instead of the ` finders ` setting.
134
136
135
137
@@ -232,7 +234,7 @@ return [
232
234
```
233
235
234
236
This enriches the list of Symbols PHP-Scoper's Reflector considers as "internal",
235
- i.e. PHP engine or extension symbols. Such symbols will be left completely
237
+ i.e. PHP engine or extension symbols. Such symbols will be left completely
236
238
untouched.*
237
239
238
240
* : There is _ one_ exception, which is declarations of functions. If you have the function
@@ -337,7 +339,7 @@ Notes:
337
339
- An excluded symbol will not be exposed. If for example you expose the class
338
340
` Acme\Foo ` but the ` Acme ` namespace is excluded, then ` Acme\Foo ` will NOT
339
341
be exposed.
340
- - Exposing a namespace also exposes its sub-namespaces (with the aforementioned
342
+ - Exposing a namespace also exposes its sub-namespaces (with the aforementioned
341
343
note applying)
342
344
- Exposing symbols will most likely require PHP-Scoper to adjust the Composer
343
345
autoloader. To do so with minimal conflicts, PHP-Scoper dumps everything
@@ -358,7 +360,7 @@ The namespace configuration is identical to [excluding namespaces](#excluding-na
358
360
359
361
How the symbols are exposed is done as described in the next sections. Note
360
362
however that some symbols cannot be exposed (see [ exposing/excluding traits] ( limitations.md#exposingexcluding-traits )
361
- and [ exposing/excluding enums] ( limitations.md#exposingexcluding-enums ) )
363
+ and [ exposing/excluding enums] ( limitations.md#exposingexcluding-enums ) )
362
364
363
365
364
366
### Exposing classes
0 commit comments