Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Target/MapBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,20 @@ public function build(Filter $filter, FileAnalyser $analyser): array
}

foreach ($this->parentClasses($classDetails, $class) as $parentClass) {
$merged = array_merge_recursive(
$classes[$class->namespacedName()] = array_merge_recursive(
$classes[$class->namespacedName()],
$classes[$parentClass->namespacedName()],
);

foreach ($merged as $mergedFile => $lines) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this loop moved after the outer loop

$merged[$mergedFile] = array_unique($lines);
if (!isset($classesThatExtendClass[$parentClass->namespacedName()])) {
Copy link
Contributor Author

@staabm staabm Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved this if-condition, so we reflect the same structure as the foreach-loop above (just readability)

continue;
}

$classes[$class->namespacedName()] = $merged;
$this->process($classesThatExtendClass, $parentClass->namespacedName(), $class->file(), $class->startLine(), $class->endLine());
}

if (isset($classesThatExtendClass[$parentClass->namespacedName()])) {
$this->process($classesThatExtendClass, $parentClass->namespacedName(), $class->file(), $class->startLine(), $class->endLine());
}
foreach ($classes[$class->namespacedName()] as $file => $lines) {
$classes[$class->namespacedName()][$file] = array_unique($lines);
}
}

Expand Down
Loading