File tree 1 file changed +0
-42
lines changed
1 file changed +0
-42
lines changed Original file line number Diff line number Diff line change 17
17
*/
18
18
final class Xdebug implements Driver
19
19
{
20
- /**
21
- * @var array
22
- */
23
- private $ cacheNumLines = [];
24
-
25
20
/**
26
21
* @var Filter
27
22
*/
@@ -68,43 +63,6 @@ public function stop(): array
68
63
69
64
\xdebug_stop_code_coverage ();
70
65
71
- return $ this ->cleanup ($ data );
72
- }
73
-
74
- private function cleanup (array $ data ): array
75
- {
76
- foreach (\array_keys ($ data ) as $ file ) {
77
- unset($ data [$ file ][0 ]);
78
-
79
- if (!$ this ->filter ->isFile ($ file )) {
80
- continue ;
81
- }
82
-
83
- $ numLines = $ this ->getNumberOfLinesInFile ($ file );
84
-
85
- foreach (\array_keys ($ data [$ file ]) as $ line ) {
86
- if ($ line > $ numLines ) {
87
- unset($ data [$ file ][$ line ]);
88
- }
89
- }
90
- }
91
-
92
66
return $ data ;
93
67
}
94
-
95
- private function getNumberOfLinesInFile (string $ fileName ): int
96
- {
97
- if (!isset ($ this ->cacheNumLines [$ fileName ])) {
98
- $ buffer = \file_get_contents ($ fileName );
99
- $ lines = \substr_count ($ buffer , "\n" );
100
-
101
- if (\substr ($ buffer , -1 ) !== "\n" ) {
102
- $ lines ++;
103
- }
104
-
105
- $ this ->cacheNumLines [$ fileName ] = $ lines ;
106
- }
107
-
108
- return $ this ->cacheNumLines [$ fileName ];
109
- }
110
68
}
You can’t perform that action at this time.
0 commit comments