-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Let's say you have the following:
final readonly class SomeModel
{
public function __construct(
private string $name,
) {}
public function getName() : string
{
return $this->name;
}
}
And you return it inside a controller to a Twig template like this:
#[AsController]
final class SomeController extends AbstractController
{
#[Route(path: '/some', name: 'some')]
#[Template('some.html.twig')]
public function __invoke() : array
{
return [
'some' => new SomeModel('Ruud')
];
}
}
It will report that getName
is unused. But it might be, we have no idea if it is used or not since it goes to Twig.
Would it be possible to do something similar to MemberUsageExcluder, but then for Inclusion?
I want all ClassMemberUsages that originate from a Controller Action, and go to a Template, marked as used.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request