PhpSandbox\PHPSandbox::dewhitelist PHP Méthode

dewhitelist() public méthode

You can pass an associative array of whitelist types and their names, or a string $type and array of $names, or pass a string of the $type and $name to unset
public dewhitelist ( string | array $type, string | array | null $name )
$type string | array Associative array or string of whitelist type to unset
$name string | array | null Array or string of whitelist name to unset
    public function dewhitelist($type, $name)
    {
        if (is_array($type)) {
            foreach ($type as $_type => $name) {
                if (isset($this->whitelist[$_type]) && is_string($name) && $name && isset($this->whitelist[$_type][$name])) {
                    unset($this->whitelist[$_type][$name]);
                } else {
                    if (isset($this->whitelist[$_type]) && is_array($name)) {
                        foreach ($name as $_name) {
                            if (is_string($_name) && $_name && isset($this->whitelist[$_type][$_name])) {
                                unset($this->whitelist[$_type][$_name]);
                            }
                        }
                    }
                }
            }
        } else {
            if (isset($this->whitelist[$type]) && is_string($name) && $name && isset($this->whitelist[$type][$name])) {
                unset($this->whitelist[$type][$name]);
            }
        }
        return $this;
    }
PHPSandbox