PhpSandbox\PHPSandbox::blacklist PHP Méthode

blacklist() public méthode

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