Skip to content

Commit 1704f5a

Browse files
committed
cs
1 parent 233af7b commit 1704f5a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Service/CodeRunner/ClassExist.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,13 @@ public function run(array $nodes, IssueCollection $issues, string $applicationDi
3434
*/
3535
private function getClasses(CodeNode $node): array
3636
{
37-
$codeBlock = explode("\n", $node->getValue());
3837
$language = $node->getLanguage() ?? 'php';
3938
if (!in_array($language, ['php', 'php-symfony', 'php-standalone', 'php-annotations'])) {
4039
return [];
4140
}
4241

4342
$classes = [];
44-
foreach ($codeBlock as $i => $line) {
43+
foreach (explode("\n", $node->getValue()) as $i => $line) {
4544
$matches = [];
4645
if (0 !== strpos($line, 'use ') || !preg_match('|^use (.*\\\.*); *?$|m', $line, $matches)) {
4746
continue;

0 commit comments

Comments
 (0)