Skip to content

Commit

Permalink
refactor: remove unnecessary verifyInstanceOf()
Browse files Browse the repository at this point in the history
Because locateClass() already checks it.
  • Loading branch information
kenjis committed Aug 27, 2023
1 parent add2cbd commit 1b88479
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions system/Config/Factories.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,11 @@ private static function getDefinedInstance(array $options, string $alias, array
return null;
}

// Need to verify if the shared instance matches the request
if (self::verifyInstanceOf($options, $class)) {
// Check for an existing instance for the class
if (isset(self::$instances[$options['component']][$class])) {
self::setAlias($options['component'], $alias, $class);
// Check for an existing instance for the class
if (isset(self::$instances[$options['component']][$class])) {
self::setAlias($options['component'], $alias, $class);

return self::$instances[$options['component']][$class];
}
return self::$instances[$options['component']][$class];
}

return null;
Expand Down

0 comments on commit 1b88479

Please sign in to comment.