| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 27 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 28 | { |
||
| 29 | $path = $input->getArgument("path"); |
||
| 30 | $container = $this->getContainer(); |
||
|
|
|||
| 31 | |||
| 32 | $projectRepository = $this->getContainer()->get(ProjectRepository::class); |
||
| 33 | /** @var Project */ |
||
| 34 | $project = $projectRepository->findByPath($path); |
||
| 35 | $classesList = []; |
||
| 36 | foreach ($project->getIndex()->getClasses() as $class) { |
||
| 37 | $classesList[] = [ |
||
| 38 | 'fqcn' => $class->fqcn->toString(), |
||
| 39 | 'filepath' => $class->file |
||
| 40 | ]; |
||
| 41 | } |
||
| 42 | yield $output->write(json_encode($classesList)); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.