Skip to content

Commit

Permalink
chore: namespaceの表記を変更する
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokinoue committed Feb 29, 2024
1 parent 44d87ed commit 0543901
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Binary file modified example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/DiagramUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public function namespace(): string
{
$parts = explode('\\', $this->fullyQualifiedClassName);
array_pop($parts);
if (!empty($parts) && $parts[0] === '') {
array_shift($parts);
}
return implode('\\', $parts);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/DiagramUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function testクラス名と名前空間が取得できること(): void
// then
$this->assertSame('\Foo\Bar', $fullQualifiedClassName);
$this->assertSame('Bar', $className);
$this->assertSame('\Foo', $namespace);
$this->assertSame('Foo', $namespace);
}

/**
Expand Down

0 comments on commit 0543901

Please sign in to comment.