Skip to content

Commit 2393cec

Browse files
authored
fix: create alias only for classes that do not exist. (#1269)
* fix: create alias only for classes that do not exist. * style: apply styleci.
1 parent 51d3a4d commit 2393cec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Application.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,9 @@ public function withAliases($userAliases = [])
790790
$merged = array_merge($defaults, $userAliases);
791791

792792
foreach ($merged as $original => $alias) {
793-
class_alias($original, $alias);
793+
if (! class_exists($alias)) {
794+
class_alias($original, $alias);
795+
}
794796
}
795797
}
796798
}

0 commit comments

Comments
 (0)