<commit_before><?php declare(strict_types = 1);

namespace Nextras\Dbal\Bridges\NetteTracy;


use Nextras\Dbal\QueryException;
use Nextras\Dbal\Utils\SqlHighlighter;


class BluescreenQueryPanel
{
	/**
	 * @phpstan-return array{tab: string, panel: string}|null
	 */
	public static function renderBluescreenPanel(?\Throwable $exception): ?array
	{
		if (!$exception instanceof QueryException || !($query = $exception->getSqlQuery())) {
			return null;
		}

		return [
			'tab' => 'SQL',
			'panel' => '<pre class="sql">' . SqlHighlighter::highlight($query) . "</pre>",
		];
	}
}
<commit_msg>nette tracy panel: do not use deprecated exception<commit_after><?php declare(strict_types = 1);

namespace Nextras\Dbal\Bridges\NetteTracy;


use Nextras\Dbal\Drivers\Exception\QueryException;
use Nextras\Dbal\Utils\SqlHighlighter;


class BluescreenQueryPanel
{
	/**
	 * @phpstan-return array{tab: string, panel: string}|null
	 */
	public static function renderBluescreenPanel(?\Throwable $exception): ?array
	{
		if (!$exception instanceof QueryException || !($query = $exception->getSqlQuery())) {
			return null;
		}

		return [
			'tab' => 'SQL',
			'panel' => '<pre class="sql">' . SqlHighlighter::highlight($query) . "</pre>",
		];
	}
}

{'fraction_non_alphanumeric': 0.16113360323886639, 'fraction_numerical': 0.0016194331983805667, 'mean_word_length': 4.722222222222222, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1782156', 'n_tokens_mistral': 448, 'n_tokens_neox': 405, 'n_words': 83}