File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,9 @@ public function getPath(string $fqcn): string
110
110
public function getFilenameFromPathAndName (string $ path , string $ name ): string
111
111
{
112
112
$ filePath = $ this ->getSourceFolder () . DIRECTORY_SEPARATOR ;
113
+ $ filePath .= $ this ->normalizePath ($ path ) . DIRECTORY_SEPARATOR ;
113
114
114
- if ($ path = \trim ($ path , '/ ' )) {
115
- $ filePath .= $ this ->normalizePath ($ path ) . DIRECTORY_SEPARATOR ;
116
- }
115
+ $ filePath = \str_replace ('// ' , '/ ' , $ filePath );
117
116
118
117
return $ filePath . $ name . '.php ' ;
119
118
}
Original file line number Diff line number Diff line change @@ -42,6 +42,15 @@ public function it_can_be_created_from_composer(): void
42
42
43
43
$ this ->assertSame ('OpenCodeModelingTest \\CodeAst ' , $ psr4InfoList [3 ]->getPackagePrefix ());
44
44
$ this ->assertSame ('/service/tests ' , $ psr4InfoList [3 ]->getSourceFolder ());
45
+
46
+ $ this ->assertSame (
47
+ '/service/src/Domain/Model/Building/Building.php ' ,
48
+ $ psr4InfoList [0 ]->getFilenameFromPathAndName ('/service/src/Domain/Model/Building ' , 'Building ' )
49
+ );
50
+ $ this ->assertSame (
51
+ '/service/src/Domain/Model/Building/Building.php ' ,
52
+ $ psr4InfoList [0 ]->getFilenameFromPathAndName ('Domain/Model/Building ' , 'Building ' )
53
+ );
45
54
}
46
55
47
56
/**
You can’t perform that action at this time.
0 commit comments