Removed @deprecated classes, methods and properties, added some type hints

This commit is contained in:
Shoghi Cervantes
2015-09-12 17:10:11 +02:00
parent 29a5012c02
commit 3ffdb8e552
39 changed files with 166 additions and 891 deletions

View File

@ -49,34 +49,6 @@ class Utils{
}
}
/**
* @deprecated
*/
public static function randomUUID(){
return Utils::toUUID(Binary::writeInt(time()) . Binary::writeShort(getmypid()) . Binary::writeShort(getmyuid()) . Binary::writeInt(mt_rand(-0x7fffffff, 0x7fffffff)) . Binary::writeInt(mt_rand(-0x7fffffff, 0x7fffffff)), 2);
}
/**
* @deprecated
*/
public static function dataToUUID(...$params){
return Utils::toUUID(hash("md5", implode($params), true), 3);
}
/**
* @deprecated
*/
public static function toUUID($data, $version = 2, $fixed = "8"){
if(strlen($data) !== 16){
throw new \InvalidArgumentException("Data must be 16 bytes");
}
$hex = bin2hex($data);
//xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx 8-4-4-12
return substr($hex, 0, 8) . "-" . substr($hex, 8, 4) . "-" . hexdec($version) . substr($hex, 13, 3) . "-" . $fixed{0} . substr($hex, 17, 3) . "-" . substr($hex, 20, 12);
}
/**
* Gets this machine / server instance unique ID
* Returns a hash, the first 32 characters (or 16 if raw)