Skip to content

Commit afcb342

Browse files
authored
Merge pull request #10 from faissaloux/fix-toonlyuse
Fix `toOnlyUse()`
2 parents 2c242cd + c0e41fb commit afcb342

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Blueprint.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ private function getUsagePathAndLines(Layer $layer, string $objectName, string $
255255
/** @var class-string<\PhpParser\Node> $class */
256256
$class = PhpCoreExpressions::getClass($target) ?? Name::class;
257257

258+
if ($dependOnObject === null) {
259+
return null;
260+
}
261+
258262
$nodes = ServiceContainer::$nodeFinder->findInstanceOf(
259263
$dependOnObject->stmts,
260264
$class,

0 commit comments

Comments
 (0)