Skip to content

Commit f0bcfdb

Browse files
authored
Merge pull request #57 from open-code-modeling/0.10.x-merge-up-into-0.11.x_6001ae7cb9f6e2.93351564
Merge release 0.10.1 into 0.11.x
2 parents a267869 + 6b6192d commit f0bcfdb

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ All notable changes to this project will be documented in this file, in reverse
2424

2525
- Nothing.
2626

27+
## 0.10.1 - 2021-01-15
28+
29+
30+
-----
31+
32+
### Release Notes for [0.10.1](https://github.com/open-code-modeling/php-code-ast/milestone/20)
33+
34+
0.10.x bugfix release (patch)
35+
36+
### 0.10.1
37+
38+
- Total issues resolved: **1**
39+
- Total pull requests resolved: **0**
40+
- Total contributors: **1**
41+
42+
#### bug
43+
44+
- [56: Fix double slashes in path for Psr4Info](https://github.com/open-code-modeling/php-code-ast/issues/56) thanks to @sandrokeil
45+
2746
## 0.9.1 - TBD
2847

2948
### Added

src/Package/Psr4Info.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,9 @@ public function getPath(string $fqcn): string
110110
public function getFilenameFromPathAndName(string $path, string $name): string
111111
{
112112
$filePath = $this->getSourceFolder() . DIRECTORY_SEPARATOR;
113+
$filePath .= $this->normalizePath($path) . DIRECTORY_SEPARATOR;
113114

114-
if ($path = \trim($path, '/')) {
115-
$filePath .= $this->normalizePath($path) . DIRECTORY_SEPARATOR;
116-
}
115+
$filePath = \str_replace('//', '/', $filePath);
117116

118117
return $filePath . $name . '.php';
119118
}

tests/Package/Psr4InfoTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ public function it_can_be_created_from_composer(): void
4242

4343
$this->assertSame('OpenCodeModelingTest\\CodeAst', $psr4InfoList[3]->getPackagePrefix());
4444
$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+
);
4554
}
4655

4756
/**

0 commit comments

Comments
 (0)