@@ -92,6 +92,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
92
92
foreach ($ paths as $ path ) {
93
93
if (!is_string ($ path ))
94
94
return self ::RETURN_CODE_ERROR ;
95
+ $ path = realpath ($ path );
96
+ if (!$ path )
97
+ return self ::RETURN_CODE_ERROR ;
95
98
$ pathsToWeave [] = $ path ;
96
99
}
97
100
$ tracefile = $ input ->getOption ('tracefile ' );
@@ -103,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
103
106
104
107
$ filesToWeave = $ this ->getFilesToProcess ($ pathsToWeave );
105
108
106
- $ sigs = $ this ->parseTrace ($ tracefile );
109
+ $ sigs = $ this ->parseTrace ($ tracefile, $ pathsToWeave );
107
110
$ this ->transformFiles ($ filesToWeave , $ sigs );
108
111
109
112
return self ::RETURN_CODE_OK ;
@@ -146,13 +149,15 @@ private function getFilesToProcess(array $pathsToWeave): array
146
149
147
150
/**
148
151
* Parse the trace file.
152
+ *
153
+ * @param string[] $pathsToWeave
149
154
*/
150
- private function parseTrace (string $ tracefile ): Signatures
155
+ private function parseTrace (string $ tracefile, array $ pathsToWeave ): Signatures
151
156
{
152
157
$ sigs = new Signatures ();
153
158
if (is_file ($ tracefile )) {
154
159
$ traceFile = new SplFileObject ($ tracefile );
155
- $ trace = new TraceReader (new FunctionTracer (new TraceSignatureLogger ($ sigs )));
160
+ $ trace = new TraceReader (new FunctionTracer (new TraceSignatureLogger ($ sigs )), $ pathsToWeave );
156
161
157
162
$ traceFile ->setFlags (SplFileObject::READ_AHEAD );
158
163
$ this ->progressBarStart (iterator_count ($ traceFile ), '<info>Parsing tracefile …</info> ' );
0 commit comments