Skip to content

Commit

Permalink
Merge pull request #4 from k-kinzal/fixes-source-path-slash
Browse files Browse the repository at this point in the history
fixes removes trailing slash from sourcePath
  • Loading branch information
koriym authored Jul 1, 2020
2 parents f78ee97 + 16143b4 commit 0edfacb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Convert.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __invoke(string $sourcePath) : void

private function getNamespace(string $sourcePath, \SplFileInfo $phpFile) : string
{
$relativePath = substr(str_replace($sourcePath, '', (string) $phpFile->getRealPath()), 1);
$relativePath = substr(str_replace(rtrim($sourcePath, '/'), '', (string) $phpFile->getRealPath()), 1);
$dirName = dirname($relativePath);
$hasDiretocty = $dirName !== '.';

Expand Down

0 comments on commit 0edfacb

Please sign in to comment.