mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Removed @deprecated classes, methods and properties, added some type hints
This commit is contained in:
@ -321,46 +321,6 @@ class Config{
|
||||
return ($this->correct and isset($this->config[$k])) ? $this->config[$k] : $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getPath($path){
|
||||
$currPath =& $this->config;
|
||||
foreach(explode(".", $path) as $component){
|
||||
if(isset($currPath[$component])){
|
||||
$currPath =& $currPath[$component];
|
||||
}else{
|
||||
$currPath = null;
|
||||
}
|
||||
}
|
||||
|
||||
return $currPath;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @param string $path
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setPath($path, $value){
|
||||
$currPath =& $this->config;
|
||||
$components = explode(".", $path);
|
||||
$final = array_pop($components);
|
||||
foreach($components as $component){
|
||||
if(!isset($currPath[$component])){
|
||||
$currPath[$component] = [];
|
||||
}
|
||||
$currPath =& $currPath[$component];
|
||||
}
|
||||
$currPath[$final] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $k key to be set
|
||||
* @param mixed $v value to set key
|
||||
|
Reference in New Issue
Block a user