Devuelte un style de tipo "exception_header"

@param \PlanB\Beautifier\Style\StyleType $type

@return null|\PlanB\Beautifier\Style\Style
507683
public function makeExceptionHeader(StyleType $type): ?Style
    {
        if (!$type->isExceptionHeader()) {
            return null;
        }

        return Style::make()
            ->setBgColor(Color::RED())
            ->setFgColor(Color::WHITE())
            ->bold()
            ->margin(2)
            ->padding(2)
            ->align(Align::CENTER());
    }
450496
private function doCallbackMethod($type = null)
    {
        $callback = $type;
        if (is_null($callback)) {
            $callback = $this->messageTypes[$_POST['lti_message_type']];
        }
        if (isset($this->callbackHandler[$callback])) {
            $result = call_user_func($this->callbackHandler[$callback], $this);

            // Callback function may return HTML or a redirect URL
            if (is_string($result)) {
                if ((substr($result, 0, 7) == 'http://') || (substr($result, 0, 8) == 'https://')) {
                    $this->redirectUrl = $result;
                } else {
                    if (is_null($this->output)) {
                        $this->output = '';
                    }
                    $this->output .= $result;
                }
            }
        } else if (is_null($type)) {
            throw new Exception('Message type not supported');
        }
    }
7036
protected function createTemplate($type)
    {
        $class = $this->resolveTypeClassName($type);

        if (!($template = $class::inTheme($this->theme))) {
            throw new ApplicationException(trans('cms::lang.template.not_found'));
        }

        return $template;
    }
1116344
public function set_type($type) {
        if (!in_array($type, [self::TYPE_DEFAULT, self::TYPE_LINE])) {
            throw new coding_exception('Invalid serie type.');
        }
        $this->type = $type;
    }
430104
protected function readHeader($type, $size)
    {
        if ($this->position + $size > $this->headerSize) {
            throw new \Exception('Can\'t read ' . $size . ' bytes');
        }
        $data = unpack($type, substr($this->header, $this->position, $size));
        $this->position += $size;
        return $data[1];
    }
18504
public function setEncType($type) {

		$type = strtolower($type);

		if($type != 'application/x-www-form-urlencoded' && $type != 'multipart/form-data' && !empty($type)) {
			throw new HtmlFormException("Invalid form enctype: '$type'.", HtmlFormException::INVALID_ENCTYPE);
		}

		$this->encType = $type;

		return $this;

	}
1299538
public function setBodyType($type)
    {
        if ($type == 'html' || $type == 'text' || $type = 'both') {
            $this->body_type = $type;
        } else {
            throw new Exception_TMail("Unsupported body type: $type");
        }

        return $this;
    }
469876
public function getMessageClassObject($type) {
        // Type is obligatory // TODO: Configurate obligatory?
        if ($type == null) throw new Exception("Error Type is null");

        $messageClassString = $this->getMessageClassString($type);
        if ($messageClassString == null) {
            throw new Exception("Error Type");
        }

        $messageClassObject = new $messageClassString;
        if ($messageClassObject->getMyType() == "any") {
            $messageClassObject->setAnyType($type);
            $messageClassObject->setTypeClient($type);
        }

        return $messageClassObject;
    }
42070
private function getFieldClass(string $type): string
    {
        if (!array_key_exists($type, $this->fieldsMapping)) {
            throw new Exception("Field type \"{$type}\" not found in field mapping. Allowed fields are \"".implode('", "', $this->fieldsMapping).'"');
        }

        return $this->fieldsMapping[$type];
    }
212508
public function create($type)
    {
        $twigEngine = $this->getTwigEngine();
        if (!$twigEngine) {
            throw new \Exception('Twig Engine not found.  Please see https://github.com/mmucklo/DtcGridBundle/README.md for instructions.');
        }
        switch ($type) {
            case 'datatables':
                $renderer = new DataTablesRenderer($this->twigEngine, $this->router);
                break;
            case 'jq_grid':
                $renderer = new JQGridRenderer($this->twigEngine, $this->router);
                break;
            case 'table':
                $renderer = new TableGridRenderer($this->twigEngine, $this->router);
                break;
            default:
                throw new \Exception("No renderer for type '$type''");
        }

        if (method_exists($renderer, 'setThemeCss')) {
            $renderer->setThemeCss($this->themeCss);
        }

        if (method_exists($renderer, 'setThemeJs')) {
            $renderer->setThemeJs($this->themeJs);
        }

        if (method_exists($renderer, 'setJQuery')) {
            $renderer->setJQuery($this->jQuery);
        }

        if (method_exists($renderer, 'setPurl')) {
            $renderer->setPurl($this->purl);
        }

        if (method_exists($renderer, 'setPageDivStyle')) {
            $renderer->setPageDivStyle($this->pageDivStyle);
        }

        if (method_exists($renderer, 'setJqGridCss')) {
            $renderer->setJqGridCss($this->jqGridCss);
        }

        if (method_exists($renderer, 'setJqGridJs')) {
            $renderer->setJqGridJs($this->jqGridJs);
        }

        if (method_exists($renderer, 'setDataTablesCss')) {
            $renderer->setDataTablesCss($this->dataTablesCss);
        }

        if (method_exists($renderer, 'setDataTablesJs')) {
            $renderer->setDataTablesJs($this->dataTablesJs);
        }

        if (method_exists($renderer, 'setDatatablesClass') && $this->dataTablesClass) {
            $renderer->setDatatablesClass($this->dataTablesClass);
        }

        return $renderer;
    }
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;
    }
1339609
public function deleteThumbnail($type)
    {
        $app = Application::getFacadeApplication();
        $config = $app->make('config');
        if (!($type instanceof ThumbnailTypeVersion)) {
            $type = ThumbnailTypeVersion::getByHandle($type);
        }
        $fsl = $this->getFile()->getFileStorageLocationObject()->getFileSystemObject();
        $path = $type->getFilePath($this);
        try {
            if ($fsl->has($path)) {
                $fsl->delete($path);

                $app['director']->dispatch('on_thumbnail_delete',
                    new \Concrete\Core\File\Event\ThumbnailDelete($path, $type)
                );
            }
        } catch (FileNotFoundException $e) {
        }
        if ($type->getHandle() == $config->get('concrete.icons.file_manager_listing.handle') && $this->fvHasListingThumbnail) {
            $this->fvHasListingThumbnail = false;
            $this->save();
        }
        if ($type->getHandle() == $config->get('concrete.icons.file_manager_detail.handle') && $this->fvHasDetailThumbnail) {
            $this->fvHasDetailThumbnail = false;
            $this->save();
        }
    }
615225
public function getValueByType($type)
    {
        $type = strtoupper($type);

        switch ($type) {
            case static::EAN:
                return $this->asEan();

            case static::ISBN10:
                return $this->asIsbn10();

            case static::ISBN13:
                return $this->asIsbn13();

            case static::UPC:
                return $this->asUpc();

            default:
                throw new Exception("Type {$type} not supported");
        }
    }
205228
public function addStyle($style)
    {
        if (!$this->html) {
            throw new Exception(['App does not know how to add style']);
        }
        $this->html->template->appendHTML('HEAD', $this->getTag('style', $style));
    }
1135673
public function contentType($type = false)
    {

        if (headers_sent()) {
            if (self::$exceptOnHeaders) {
                throw new \Exception('Headers already sent. Content-type cannot be changed.');
            } else {
                return;
            }
        }

        if (!$type) {
            $type = "text/html";
        }

        self::$contentType = $type ."; charset=". strtolower(self::$charset);
        header("Content-Type: ". self::$contentType);
    }
1157712
protected function expect($type)
    {
        if ($this->token->getType() !== $type) {
            throw new \Exception(sprintf('Expected %s, found %s', Token::typeToString($type), (string) $this->token));
        }

        $token = $this->token;
        $this->advance();
        return $token;
    }
91957
protected function columnTypeToHintType($type) {
		if (static::$typeMap === null) {
			static::$typeMap = (array)Configure::read('IdeHelper.typeMap') + static::$typeMapDefaults;
		}

		if (isset(static::$typeMap[$type])) {
			return static::$typeMap[$type];
		}

		return null;
	}