Disable exception handling

@param integer $type The type of exceptions to disable
@return $this
544630
public function disable($type = self::TYPE_ALL)
    {
        if(($type & self::TYPE_EXCEPTION) && ($this->_exception_type & self::TYPE_EXCEPTION))
        {
            restore_exception_handler();
            $this->_exception_type ^= self::TYPE_EXCEPTION;
        }

        if(($type & self::TYPE_ERROR) && ($this->_exception_type & self::TYPE_ERROR))
        {
            restore_error_handler();
            $this->_exception_type ^= self::TYPE_ERROR;
        }

        if(($type & self::TYPE_FAILURE) && ($this->_exception_type & self::TYPE_FAILURE))
        {
            //Cannot unregister shutdown functions. Check in handler to see if it's enabled.
            $this->_exception_type ^= self::TYPE_FAILURE;
        }

        return $this;
    }
203064
public function withType(string $type): self
    {
        $this->type = UserPermissionEnum::ensureValid($type);
        return $this;
    }
121983
static function raise_exception( Exception $Ex, $type ){
		if( error_reporting() === 0 ){
			// suppressed with `@' operator
			return;
		}
		PLUG::clear_error_handlers();
		$code = $Ex->getCode() or $code = PLUG_EXCEPTION_STD;
		$Err = new PLUGError( $code, $type, $Ex->getMessage(), $Ex->getFile(), $Ex->getLine(), $Ex->getTrace() );
		$Err->raise();
		PLUG::set_error_handlers();
		return $Err;
	}
467391
public static function setCurrentIntegrationType($type)
    {
        if (!self::integrationTypes()[$type]) {
            $integrationTypes = array_keys(self::integrationTypes());
            $integrationTypesAsString = join($integrationTypes, ", ");
            throw new \Exception('Invalid integration type, valid values are: ' . $integrationTypesAsString);
        }
        self::$integrationType = $type;
    }
911468
public function setFullyQualifiedType(string $type): self
    {
        if ('' === $type) {
            $this->fully_qualified_type = '';

            return $this;
        }

        if ($type[0] === '\\') {
            $this->fully_qualified_type = $type;

            return $this;
        }

        throw new \DomainException(sprintf('The type %s is not a valid fully qualified class name', $type));
    }
433227
private function setType(string $type): self
    {
        switch ($type) {
            case 'navigator.id.getAssertion': // fall through
            case 'navigator.id.finishEnrollment':
                break;
            default:
                throw new IDE(IDE::MALFORMED_DATA, 'typ');
        }
        $this->typ = $type;
        return $this;
    }
603112
public function disallow($type)
    {
        if (!is_array($type)) {
            $type = func_get_args();
        }
        $this->disallowedTypes = implode(',', $type);

        return $this;
    }
289421
public function addDisallowedType($type)
    {
        if (!in_array(strtolower($type), $this->disallowedTypes)) {
            $this->disallowedTypes[] = strtolower($type);
        }
        return $this;
    }
41521
public function setExportHandler($type)
    {
        if (
            $type === self::EXPORT_NORMAL ||
            $type === self::EXPORT_ARRAY ||
            $type === self::EXPORT_SKIP ||
            is_callable($type)
        ) {
            $this->exportHandler = $type;
            return $this;
        }

        throw new InvalidArgumentException(
            "invalid value provided for 'type'; ".
            "expecting a callable, or one of the following contstants: ".
            "sndsgd\Field::EXPORT_NORMAL, sndsgd\Field::EXPORT_ARRAY, or ".
            "sndsgd\Field::EXPORT_SKIP"
        );
    }
600575
public function unsetHandler($type, \fpoirotte\Pssht\HandlerInterface $handler)
    {
        if (!is_int($type) || $type < 0 || $type > 255) {
            throw new \InvalidArgumentException();
        }

        if (isset($this->handlers[$type]) && $this->handlers[$type] === $handler) {
            unset($this->handlers[$type]);
        }
        return $this;
    }
120915
public function setExceptionType(string $exceptionType): self
    {
        try {
            $ref = new \ReflectionClass($exceptionType);
            if (!$ref->implementsInterface(\Throwable::class)) {
                throw new \InvalidArgumentException('Exception class must implement Throwable interface');
            }
        } catch (\ReflectionException $e) {
            throw new \InvalidArgumentException('Exception class not found');
        }

        $this->exceptionType = $exceptionType;
        return $this;
    }
940917
final public function handler($type = 'error', $action = 'restore', $callable_handler = false, $error_types = null)
    {
        if (empty($error_types)) {
            $error_types = E_ALL | E_STRICT;
        }
        switch (strtolower($type)) {
            case 'error':
                switch (strtolower($action)) {
                    case 'restore':
                        return restore_error_handler();
                        break;
                    case 'set':
                        return set_error_handler($callable_handler, $error_types);
                        break;
                    default:
                        return false;
                }
                break;
            case 'exception':
                switch (strtolower($action)) {
                    case 'restore':
                        return restore_exception_handler();
                        break;
                    case 'set':
                        return set_exception_handler($callable_handler);
                        break;
                    default:
                        return false;
                }
                break;
            default:
                return false;
        }
    }
778246
public function setExceptions(array $exceptions)
    {
        $this->exceptions = array();
        foreach ($exceptions as $exception) {
            $this->add($exception);
        }

        return $this;
    }
267048
public function addException(\Exception $e)
    {
        if ($this->initialized && $this->enabled()) {
            $this->debugbar['exceptions']->addException($e);
        }

        return $this;
    }
1305702
protected function addException($msg = null, $type = 'info')
    {
        if (null === $msg) {
            return;
        }

        if (!isset($this->exceptionStore[$type])) {
            $this->exceptionStore[$type] = [];
        }

        $this->exceptionStore[$type][] = $msg;
    }
817910
public function setType($type)
    {
        if (!array_key_exists($type, $this->allowConditionRunType)) {
            $errMsg = sprintf('Not allowed type %s', $type);
            throw new Exception\InvalidMetadataException($errMsg);
        }
        $this->type = $type;

        return $this;
    }
366812
public function forType(string $type): HandlerInterface
    {
        if (!in_array($type, ['integer', 'float', 'integer|float', 'float|integer'])) {
            throw new LogicException("Unable to use " . get_class($this) . " to cast to $type");
        }

        if ($this->type === $type || ((strpos($this->type, '|') !== false && strpos($type, '|') !== false))) {
            return $this;
        }

        $handler = clone $this;
        $handler->type = $type;

        return $handler;
    }