Skip to content
This repository has been archived by the owner on Apr 30, 2019. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelspiss committed Apr 20, 2017
2 parents c49b342 + 6333bb7 commit e380e08
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Multiton.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ trait Multiton {

/**
* @param $identifier
* @return Multiton
* @return static
*/
final public static function getInstance($identifier) {
if(!isset(self::$_instances[$identifier])) {
self::$_instances[$identifier] = new self($identifier);
$class_name = get_called_class();
if(!isset(self::$_instances[$class_name][$identifier])) {
self::$_instances[$class_name][$identifier] = new $class_name($identifier);
}
return self::$_instances[$identifier];
return self::$_instances[$class_name][$identifier];
}

/**
Expand Down

0 comments on commit e380e08

Please sign in to comment.