File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ public function __construct(
31
31
protected array $ methods = [],
32
32
protected array $ tags = [],
33
33
) {
34
+ $ this ->setId ($ this ->id );
34
35
$ this ->concrete ??= $ this ->id ;
35
36
}
36
37
@@ -47,13 +48,13 @@ public function hasTag(string $tag): bool
47
48
48
49
public function setId (string $ id ): DefinitionInterface
49
50
{
50
- $ this ->id = $ id ;
51
+ $ this ->id = static :: normaliseAlias ( $ id) ;
51
52
return $ this ;
52
53
}
53
54
54
55
public function getId (): string
55
56
{
56
- return $ this ->id ;
57
+ return static :: normaliseAlias ( $ this ->id ) ;
57
58
}
58
59
59
60
public function setAlias (string $ id ): DefinitionInterface
@@ -206,10 +207,6 @@ protected function invokeMethods(object $instance): object
206
207
207
208
public static function normaliseAlias (string $ alias ): string
208
209
{
209
- if (str_starts_with ($ alias , '\\' )) {
210
- return substr ($ alias , 1 );
211
- }
212
-
213
- return $ alias ;
210
+ return ltrim ($ alias , "\\" );
214
211
}
215
212
}
You can’t perform that action at this time.
0 commit comments