<?php


namespace CMSMSExt\core;

/**
 *
 */
class registry
{
  private $_data = [];
  
  public function set($key, $value) : registry
  {
    $this->_data[$key] = $value;
    
    return $this;
  }
  
  public function get($key, $default = null)
  {
    return $this->_data[$key] ?? $default;
  }
  
  public function has($key) : bool
  {
    return isset($this->_data[$key]);
  }
  
  public function remove($key) : registry
  {
    unset($this->_data[$key]);
    
    return $this;
  }
  
  public function getAll() : array
  {
    return $this->_data;
  }
}


?>