mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Merge branch 'release/3.3' into release/3.4
This commit is contained in:
@ -52,6 +52,23 @@ class Utils{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a readable identifier for the class of the given object. Sanitizes class names for closures.
|
||||
*
|
||||
* @param object $obj
|
||||
*
|
||||
* @return string
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public static function getNiceClassName(object $obj) : string{
|
||||
$reflect = new \ReflectionClass($obj);
|
||||
if($reflect->isAnonymous()){
|
||||
return "anonymous@" . self::cleanPath($reflect->getFileName()) . "#L" . $reflect->getStartLine();
|
||||
}
|
||||
|
||||
return $reflect->getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets this machine / server instance unique ID
|
||||
* Returns a hash, the first 32 characters (or 16 if raw)
|
||||
|
Reference in New Issue
Block a user