Skip to content

Commit e99540d

Browse files
committed
Fix namespace of test and re-approach trimming because travis complains
1 parent 697c031 commit e99540d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/Types/Context.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,17 @@ public function __construct($namespace, array $namespaceAliases = [])
4848
: '';
4949

5050
foreach ($namespaceAliases as $alias => $fqnn) {
51-
$this->namespaceAliases[$alias] = trim((string)$fqnn, '\\');
51+
if ($fqnn[0] === '\\') {
52+
$fqnn = substr($fqnn, 1);
53+
}
54+
if ($fqnn[count($fqnn)-1] === '\\') {
55+
$fqnn = substr($fqnn, 0, -1);
56+
}
57+
58+
$namespaceAliases[$alias] = $fqnn;
5259
}
60+
61+
$this->namespaceAliases = $namespaceAliases;
5362
}
5463

5564
/**

tests/unit/Types/ContextTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @link http://phpdoc.org
1111
*/
1212

13-
namespace phpDocumentor\Reflection\DocBlock;
13+
namespace phpDocumentor\Reflection\Types;
1414

1515
use Mockery as m;
1616

0 commit comments

Comments
 (0)