-
Notifications
You must be signed in to change notification settings - Fork 6
/
sample.config.php
75 lines (69 loc) · 3.34 KB
/
sample.config.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
<?php
return [
/** These functions are called before a package is processed */
"prepare" => [
function(string $package, array $config, string $path, string $namespacePrefix) {
/**
* @var string $package The name of the composer package
* @var array $config The parsed composer.json config for the package
* @var string $path The full path to the package
* @var string $namespacePrefix The namespace prefix
*/
return $config; // You should always return the $config after manipulating it
}
],
/** These functions are called once the source file has been loaded but before all of the namespace changes are processed. */
"start" => [
function(string $source, ?string $currentNamespace, string $namespacePrefix, string $package, string $file) {
/**
* @var string $source The PHP source file contents
* @var string|null $currentNamespace The current namespace of the source file (without new prefix)
* @var string $namespacePrefix The new namespace prefix
* @var string $package The name of the composer package
* @var string $file The complete path to the source file
*/
return $source; // You should always return the $source after manipulating it
},
],
/** These functions are called once per namespace being processed before the regex's are run. */
"before" => [
function(string $source, string $namespace, ?string $currentNamespace, string $namespacePrefix, string $package, string $file) {
/**
* @var string $source The PHP source file contents
* @var string $namespace The namespace currently being processed
* @var string|null $currentNamespace The current namespace of the source file (without new prefix)
* @var string $namespacePrefix The new namespace prefix
* @var string $package The name of the composer package
* @var string $file The complete path to the source file
*/
return $source; // You should always return the $source after manipulating it
}
],
/** These functions are called once per namespace being processed after the regex's are run. */
"after" => [
function(string $source, string $namespace, ?string $currentNamespace, string $namespacePrefix, string $package, string $file) {
/**
* @var string $source The PHP source file contents
* @var string $namespace The namespace currently being processed
* @var string|null $currentNamespace The current namespace of the source file (without new prefix)
* @var string $namespacePrefix The new namespace prefix
* @var string $package The name of the composer package
* @var string $file The complete path to the source file
*/
return $source; // You should always return the $source after manipulating it
}
],
/** These functions are called before the changed source file is saved, after all the processing has taken place. */
"end" => [
function(string $source, ?string $currentNamespace, string $namespacePrefix, string $package, string $file) {
/**
* @var string $source The PHP source file contents
* @var string|null $currentNamespace The current namespace of the source file (without new prefix)
* @var string $namespacePrefix The new namespace prefix
* @var string $package The name of the composer package
* @var string $file The complete path to the source file
*/
return $source; // You should always return the $source after manipulating it
},
]
];