@@ 32-50 (lines=19) @@ | ||
29 | * @param $index |
|
30 | * @return array |
|
31 | */ |
|
32 | private function removeLeading($lines, $index): array |
|
33 | { |
|
34 | $line = ''; |
|
35 | $remove = []; |
|
36 | ||
37 | while(! $this->startOfMethod($line)) { |
|
38 | $line = $lines[$index]; |
|
39 | ||
40 | $remove[] = $index; |
|
41 | ||
42 | $index--; |
|
43 | } |
|
44 | ||
45 | if (trim($lines[$index]) === '') { |
|
46 | $remove[] = $index; |
|
47 | } |
|
48 | ||
49 | return $remove; |
|
50 | } |
|
51 | ||
52 | /** |
|
53 | * @param $lines |
|
@@ 57-75 (lines=19) @@ | ||
54 | * @param $index |
|
55 | * @return array |
|
56 | */ |
|
57 | private function removeTrailing($lines, $index): array |
|
58 | { |
|
59 | $line = ''; |
|
60 | $remove = []; |
|
61 | ||
62 | while(! $this->endOfMethod($line)) { |
|
63 | $line = $lines[$index]; |
|
64 | ||
65 | $remove[] = $index; |
|
66 | ||
67 | $index++; |
|
68 | } |
|
69 | ||
70 | if (trim($lines[$index]) === '') { |
|
71 | $remove[] = $index; |
|
72 | } |
|
73 | ||
74 | return $remove; |
|
75 | } |
|
76 | ||
77 | /** |
|
78 | * @param $line |