File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ public function dump(array $options = [])
309
309
$ this ->asFiles = false ;
310
310
311
311
if ($ this ->preload && null !== $ autoloadFile = $ this ->getAutoloadFile ()) {
312
- $ autoloadFile = substr ($ this ->export ($ autoloadFile ), 2 , - 1 );
312
+ $ autoloadFile = trim ($ this ->export ($ autoloadFile ), ' () \\' );
313
313
314
314
$ code [$ options ['class ' ].'.preload.php ' ] = <<<EOF
315
315
<?php
@@ -2076,9 +2076,7 @@ private function doExport($value, bool $resolveEnv = false)
2076
2076
2077
2077
private function getAutoloadFile (): ?string
2078
2078
{
2079
- if (null === $ this ->targetDirRegex ) {
2080
- return null ;
2081
- }
2079
+ $ file = null ;
2082
2080
2083
2081
foreach (spl_autoload_functions () as $ autoloader ) {
2084
2082
if (!\is_array ($ autoloader )) {
@@ -2097,14 +2095,14 @@ private function getAutoloadFile(): ?string
2097
2095
if (0 === strpos ($ class , 'ComposerAutoloaderInit ' ) && $ class ::getLoader () === $ autoloader [0 ]) {
2098
2096
$ file = \dirname ((new \ReflectionClass ($ class ))->getFileName (), 2 ).'/autoload.php ' ;
2099
2097
2100
- if (preg_match ($ this ->targetDirRegex .'A ' , $ file )) {
2098
+ if (null !== $ this -> targetDirRegex && preg_match ($ this ->targetDirRegex .'A ' , $ file )) {
2101
2099
return $ file ;
2102
2100
}
2103
2101
}
2104
2102
}
2105
2103
}
2106
2104
2107
- return null ;
2105
+ return $ file ;
2108
2106
}
2109
2107
2110
2108
private function getClasses (Definition $ definition ): array
You can’t perform that action at this time.
0 commit comments