Skip to content

Commit 1f18dbf

Browse files
author
John Robertson
committed
replaced loop exit with a thrown exception
1 parent db1ea4e commit 1f18dbf

File tree

1 file changed

+7
-1
lines changed
  • lib/internal/Magento/Framework/ObjectManager/Config

1 file changed

+7
-1
lines changed

lib/internal/Magento/Framework/ObjectManager/Config/Config.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,17 @@ public function isShared($type)
152152
*
153153
* @param string $instanceName
154154
* @return mixed
155+
* @throws \LogicException
155156
*/
156157
public function getInstanceType($instanceName)
157158
{
158159
while (isset($this->_virtualTypes[$instanceName])) {
159-
if ($instanceName == $this->_virtualTypes[$instanceName]) break;
160+
if ($instanceName == $this->_virtualTypes[$instanceName]) {
161+
throw new \LogicException(
162+
'unsupported self-referencing virutal type: '
163+
.$instanceName
164+
);
165+
}
160166
$instanceName = $this->_virtualTypes[$instanceName];
161167
}
162168
return $instanceName;

0 commit comments

Comments
 (0)