LanguageDetector\Config::__set_state PHP Method

__set_state() public static method

public static __set_state ( array $state )
$state array
    public static function __set_state(array $state)
    {
        $obj = new self();
        foreach ($state as $k => $v) {
            $obj->{$k} = $v;
        }
        return $obj;
    }

Usage Example

 /**
  * {@inheritDoc}
  */
 public function load()
 {
     $file = file_get_contents($this->path);
     $object = json_decode($file, true);
     $object['config'] = Config::__set_state($object['config']);
     return $object;
 }