<commit_before>{% extends '@WebProfiler/Profiler/layout.html.twig' %}

{% import _self as macro %}

{% block toolbar %}
    {% if collector.totalRequests > 0 %}
        {% set icon %}
            {% if constant('Symfony\\Component\\HttpKernel\\Kernel::VERSION_ID') >= 20800 %}
                {{ include('@Httplug/Icon/httplug.svg') }}
            {% else %}
                {{ include('@Httplug/Icon/httplug_old.svg') }}
            {% endif %}
            <span class="sf-toolbar-value">{{ collector.totalRequests }}</span>
            <span class="sf-toolbar-label">req.</span>
        {% endset %}

        {% set text %}
            <div class="sf-toolbar-info-piece">
                <b>Successful requests</b>
                <span>{{ collector.sucessfulRequests }}</span>
            </div>
            <div class="sf-toolbar-info-piece">
                <b>Failed requests</b>
                <span>{{ collector.failedRequests }}</span>
            </div>

        {% endset %}
        {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
    {% endif %}
{% endblock %}

{% block head %}
    <link rel="stylesheet" href="{{ asset('bundles/httplug/style/httplug.css') }}" />
    <script type="text/javascript" src="{{ asset("bundles/httplug/script/httplug.js") }}"></script>
    {{ parent() }}
{% endblock %}

{% block menu %}
    {# This left-hand menu appears when using the full-screen profiler. #}
    <span class="label {{ collector.totalRequests == 0 ? 'disabled' }}">
        <span class="icon">
            {% if constant('Symfony\\Component\\HttpKernel\\Kernel::VERSION_ID') >= 20800 %}
                {{ include('@Httplug/Icon/httplug.svg') }}
            {% else %}
                {{ include('@Httplug/Icon/httplug_old.svg') }}
            {% endif %}
        </span>
        <strong>Httplug</strong>
    </span>
{% endblock %}

{% block panel %}
    <h2>HTTPlug</h2>
    <button class="btn push-right" onclick="httplug_toggleBody(this)" data-label="Hide message body">Show message body</button>

    <div class="sf-tabs">
        {% for name, client in collector.clients %}
        <div class="tab">
            <h3 class="tab-title">{{ name }} <span class="badge">{{ client.stackIndexKeys|length }}</span></h3>

            <div class="tab-content">
                <p class="help">
                    These messages are sent by client named "{{ name }}".
                </p>

                {% for stackIndex in client.stackIndexKeys %}
                    {% set failureStack = client.failureStack(stackIndex) %}
                    <h3>
                        Request #{{ stackIndex }}
                        {% if failureStack[0] %}
                            - <span class="httplug-error">Errored</span>
                        {% endif %}
                    </h3>
                    {{ macro.printMessages(client.requstStack(stackIndex), client.responseStack(stackIndex), failureStack, collector.journal.plugins(name)) }}
                {% endfor %}
            </div>
        </div>
        {% else %}
            <div class="empty">
                <p>No request were sent.</p>
            </div>
        {% endfor %}

    </div>

{% endblock %}

{% macro printMessages(requestStack, responseStack, failureStack, pluginNames) %}
    <table class="httplug-request-table">
        <tr>
            <th width="50%">Request</th>
            <th width="50%">Response</th>
        </tr>

        <tr>
            <td>{{ requestStack[responseStack|length-1]|httplug_markup|nl2br }}</td>
            <td>{{ responseStack[0]|httplug_markup|nl2br }}</td>
        </tr>
        {% if requestStack|length > 1 %}
            <tr>
                <td colspan="2" style="text-align:center">
                    <button class="btn" onclick="httplug_togglePluginStack(this)" data-label="Hide plugin stack">See plugin stack</button>
                </td>
            </tr>
            {% for idx in 0..requestStack|length-1 %}
                {% if loop.first %}
                    {# We do not have a plugin at the first entry in the stack #}
                    <tr class="httplug-request-stack">
                        <td class="httplug-plugin-name">&darr; Start </td>
                        <td class="httplug-plugin-name">- End
                            {% if failureStack[idx] %}
                                <span class="httplug-error">&#9747;</span>
                            {% endif %}
                        </td>
                    </tr>
                {% else %}
                    <tr class="httplug-request-stack">
                        <td class="httplug-plugin-name">&darr; {{ pluginNames[idx-1] }} </td>
                        <td class="httplug-plugin-name">&uarr;
                            {% if failureStack[idx] %}
                                <span class="httplug-error">&#9747;</span>
                            {% endif %}
                        </td>
                    </tr>
                {% endif %}
                <tr class="httplug-request-stack">
                    <td>{{ requestStack[idx]|httplug_markup|nl2br }}</td>
                    <td>{{ responseStack[idx]|httplug_markup|nl2br }}</td>
                </tr>
                {% if loop.last %}
                    <tr class="httplug-request-stack">
                        <td class="httplug-plugin-name">&#10230; <span class="push-right">HTTP client</span></td>
                        <td class="httplug-plugin-name">&uarr;</td>
                    </tr>
                {% endif %}
            {% endfor %}
        {% endif %}
    </table>
{% endmacro %}<commit_msg>Move the exception symbol one step up in the stack<commit_after>{% extends '@WebProfiler/Profiler/layout.html.twig' %}

{% import _self as macro %}

{% block toolbar %}
    {% if collector.totalRequests > 0 %}
        {% set icon %}
            {% if constant('Symfony\\Component\\HttpKernel\\Kernel::VERSION_ID') >= 20800 %}
                {{ include('@Httplug/Icon/httplug.svg') }}
            {% else %}
                {{ include('@Httplug/Icon/httplug_old.svg') }}
            {% endif %}
            <span class="sf-toolbar-value">{{ collector.totalRequests }}</span>
            <span class="sf-toolbar-label">req.</span>
        {% endset %}

        {% set text %}
            <div class="sf-toolbar-info-piece">
                <b>Successful requests</b>
                <span>{{ collector.sucessfulRequests }}</span>
            </div>
            <div class="sf-toolbar-info-piece">
                <b>Failed requests</b>
                <span>{{ collector.failedRequests }}</span>
            </div>

        {% endset %}
        {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
    {% endif %}
{% endblock %}

{% block head %}
    <link rel="stylesheet" href="{{ asset('bundles/httplug/style/httplug.css') }}" />
    <script type="text/javascript" src="{{ asset("bundles/httplug/script/httplug.js") }}"></script>
    {{ parent() }}
{% endblock %}

{% block menu %}
    {# This left-hand menu appears when using the full-screen profiler. #}
    <span class="label {{ collector.totalRequests == 0 ? 'disabled' }}">
        <span class="icon">
            {% if constant('Symfony\\Component\\HttpKernel\\Kernel::VERSION_ID') >= 20800 %}
                {{ include('@Httplug/Icon/httplug.svg') }}
            {% else %}
                {{ include('@Httplug/Icon/httplug_old.svg') }}
            {% endif %}
        </span>
        <strong>Httplug</strong>
    </span>
{% endblock %}

{% block panel %}
    <h2>HTTPlug</h2>
    <button class="btn push-right" onclick="httplug_toggleBody(this)" data-label="Hide message body">Show message body</button>

    <div class="sf-tabs">
        {% for name, client in collector.clients %}
        <div class="tab">
            <h3 class="tab-title">{{ name }} <span class="badge">{{ client.stackIndexKeys|length }}</span></h3>

            <div class="tab-content">
                <p class="help">
                    These messages are sent by client named "{{ name }}".
                </p>

                {% for stackIndex in client.stackIndexKeys %}
                    {% set failureStack = client.failureStack(stackIndex) %}
                    <h3>
                        Request #{{ stackIndex }}
                        {% if failureStack[0] %}
                            - <span class="httplug-error">Errored</span>
                        {% endif %}
                    </h3>
                    {{ macro.printMessages(client.requstStack(stackIndex), client.responseStack(stackIndex), failureStack, collector.journal.plugins(name)) }}
                {% endfor %}
            </div>
        </div>
        {% else %}
            <div class="empty">
                <p>No request were sent.</p>
            </div>
        {% endfor %}

    </div>

{% endblock %}

{% macro printMessages(requestStack, responseStack, failureStack, pluginNames) %}
    <table class="httplug-request-table">
        <tr>
            <th width="50%">Request</th>
            <th width="50%">Response</th>
        </tr>

        <tr>
            <td>{{ requestStack[responseStack|length-1]|httplug_markup|nl2br }}</td>
            <td>{{ responseStack[0]|httplug_markup|nl2br }}</td>
        </tr>
        {% if requestStack|length > 1 %}
            <tr>
                <td colspan="2" style="text-align:center">
                    <button class="btn" onclick="httplug_togglePluginStack(this)" data-label="Hide plugin stack">See plugin stack</button>
                </td>
            </tr>
            {% for idx in 0..requestStack|length-1 %}
                {% if loop.first %}
                    {# We do not have a plugin at the first entry in the stack #}
                    <tr class="httplug-request-stack">
                        <td class="httplug-plugin-name">&darr; Start </td>
                        <td class="httplug-plugin-name">- End
                            {% if failureStack[idx] %}
                                <span class="httplug-error">&#9747;</span>
                            {% endif %}
                        </td>
                    </tr>
                {% else %}
                    <tr class="httplug-request-stack">
                        <td class="httplug-plugin-name">&darr; {{ pluginNames[idx-1] }} </td>
                        <td class="httplug-plugin-name">&uarr;
                            {% if failureStack[idx-1] %}
                                <span class="httplug-error">&#9747;</span>
                            {% endif %}
                        </td>
                    </tr>
                {% endif %}
                <tr class="httplug-request-stack">
                    <td>{{ requestStack[idx]|httplug_markup|nl2br }}</td>
                    <td>{{ responseStack[idx]|httplug_markup|nl2br }}</td>
                </tr>
                {% if loop.last %}
                    <tr class="httplug-request-stack">
                        <td class="httplug-plugin-name">&#10230; <span class="push-right">HTTP client</span></td>
                        <td class="httplug-plugin-name">&uarr;
                            {% if failureStack[idx-1] %}
                                <span class="httplug-error">&#9747;</span>
                            {% endif %}
                        </td>
                    </tr>
                {% endif %}
            {% endfor %}
        {% endif %}
    </table>
{% endmacro %}
{'fraction_non_alphanumeric': 0.1587246577716167, 'fraction_numerical': 0.008664009703690868, 'mean_word_length': 1.52582056892779, 'pattern_counts': {'":': 0, '<': 203, '<?xml version=': 0, '>': 211, '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': '4024929', 'n_tokens_mistral': 3465, 'n_tokens_neox': 3081, 'n_words': 589}