Skip to content

Commit 3b71ac6

Browse files
committed
tweak: fix GT prefix
closes #147
1 parent 54ed5c8 commit 3b71ac6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Container.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ public function addLoaderClass(object $object):void {
7171
* @return null|T
7272
*/
7373
public function get(string $id):mixed {
74+
// This first "has" check is temporary, while all repositories switch from Gt to GT.
75+
if(!$this->has($id)) {
76+
if(str_starts_with($id, "GT\\")
77+
&& !str_starts_with($id, "GT\\Website\\")) {
78+
$id = preg_replace('/^GT\\\/', "Gt\\", $id);
79+
}
80+
}
7481
if(!$this->has($id)) {
7582
throw new ServiceNotFoundException($id);
7683
}

0 commit comments

Comments
 (0)