Utils: don't assume that callable is only array|string implicitly

this should really support closures too, but since it's not used anywhere, I feel OK with this change.
This commit is contained in:
Dylan K. Taylor 2020-04-15 12:08:33 +01:00
parent b193d9f919
commit 42a08e7e4a

View File

@ -111,8 +111,10 @@ class Utils{
public static function getCallableIdentifier(callable $variable){
if(is_array($variable)){
return sha1(strtolower(spl_object_hash($variable[0])) . "::" . strtolower($variable[1]));
}else{
}elseif(is_string($variable)){
return sha1(strtolower($variable));
}else{
throw new AssumptionFailedError("Unhandled callable type");
}
}