What potential security risks are present in the Registry class implementation?

One potential security risk in the Registry class implementation is that it allows direct access to global variables, which can lead to unintended modifications or exposure of sensitive data. To mitigate this risk, it is recommended to implement proper access control mechanisms and validation checks when setting or getting values from the registry.

class Registry {
    private $data = [];

    public function set($key, $value) {
        // Implement access control and validation checks here
        $this->data[$key] = $value;
    }

    public function get($key) {
        // Implement access control and validation checks here
        return isset($this->data[$key]) ? $this->data[$key] : null;
    }
}