| Conditions | 3 |
| Paths | 4 |
| Total Lines | 28 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function runMacro( |
||
| 16 | string $inputDirectory, |
||
| 17 | string $outputDirectory, |
||
| 18 | string & $content // Intentionally & |
||
| 19 | ): void |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * Everything except for title and sections |
||
| 23 | */ |
||
| 24 | $heading = $this->findHeading($content); |
||
| 25 | |||
| 26 | $lines = explode("\n", $content); |
||
| 27 | |||
| 28 | [1 => $siteSections, 2 => $methodSections] = $this->findSections($lines); |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Now put allowed lines back together |
||
| 32 | */ |
||
| 33 | $content = "$heading\n\n"; |
||
| 34 | |||
| 35 | foreach ($siteSections as $siteSection) { |
||
| 36 | $content .= "$siteSection\n"; |
||
| 37 | } |
||
| 38 | |||
| 39 | foreach ($methodSections as $methodSection) { |
||
| 40 | $content .= "$methodSection\n"; |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 68 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.