Skip to content

Commit

Permalink
Merge pull request #200 from koriym/soothe_psalm
Browse files Browse the repository at this point in the history
Soothe psalm
  • Loading branch information
koriym committed Aug 9, 2023
2 parents 91c6aad + 9052c1b commit 18f58cf
Show file tree
Hide file tree
Showing 4 changed files with 308 additions and 182 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"php": "^7.2 || ^8.0",
"doctrine/annotations": "^1.12",
"koriym/attributes": "^1.0.3",
"nikic/php-parser": "^4.13.2"
"nikic/php-parser": "^4.16"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4.1",
Expand Down
2 changes: 1 addition & 1 deletion src/CodeGen.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function generate(ReflectionClass $sourceClass, BindInterface $bind): Cod
*/
private function getNamespace(CodeVisitor $source)
{
$parts = $source->namespace->name->parts ?? [];
$parts = isset($source->namespace->name) ? $source->namespace->name->getParts() : [];
$ns = implode('\\', $parts);

return $ns ? $ns : null;
Expand Down
2 changes: 1 addition & 1 deletion src/CodeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private function enterNodeClass(Node $node)

private function addUse(Use_ $use): void
{
$index = implode('\\', $use->uses[0]->name->parts);
$index = implode('\\', $use->uses[0]->name->getParts());
$this->use[$index] = $use;
}
}
Loading

0 comments on commit 18f58cf

Please sign in to comment.