• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aplus-framework / debug / 15719787684

17 Jun 2025 10:50PM UTC coverage: 97.449%. Remained the same
15719787684

push

github

natanfelles
Upgrade PrismJS to version 1.30.0

573 of 588 relevant lines covered (97.45%)

3.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

99.03
/src/Views/debugbar/debugbar.php
1
<?php
2

3
use Framework\Debug\Debugger;
4

5
/**
6
 * @var array<string,Framework\Debug\Collection> $collections
7
 * @var array<string,mixed> $activities
8
 * @var array<string,mixed> $options
9
 */
10
$infoIcon = file_get_contents(__DIR__ . '/icons/info.svg');
8✔
11
$hasInfoLink = isset($options['info_link']);
8✔
12
if ($hasInfoLink) {
8✔
13
    if (!isset($options['info_link']['href']) || !isset($options['info_link']['text'])) {
2✔
14
        throw new LogicException('Info link must contain "href" and "text" keys');
1✔
15
    }
16
}
17
$iconPath = __DIR__ . '/icon.png';
8✔
18
if (isset($options['icon_path'])) {
8✔
19
    $iconPath = $options['icon_path'];
2✔
20
}
21
if (!is_file($iconPath)) {
8✔
22
    throw new LogicException('Icon not found: ' . $iconPath);
1✔
23
}
24
?>
25
<!-- Aplus Framework Debugbar start -->
7✔
26
<style>
7✔
27
    <?= file_get_contents(__DIR__ . '/../assets/prism-aplus.css') ?>
7✔
28
</style>
7✔
29
<style>
7✔
30
    <?php
7✔
31
    $contents = file_get_contents(__DIR__ . '/styles.css');
7✔
32
if (isset($options['color'])) {
7✔
33
    $contents = strtr($contents, ['magenta' => $options['color']]); // @phpstan-ignore-line
1✔
34
}
35
echo $contents;
7✔
36
?>
37
</style>
7✔
38
<div id="debugbar" class="aplus-debug" dir="ltr">
7✔
39
    <div class="panels">
7✔
40
        <div class="panel info-collection">
7✔
41
            <div class="resize" title="Change panel height"></div>
7✔
42
            <header>
7✔
43
                <div class="title"><?= $infoIcon ?> Info</div>
7✔
44
            </header>
45
            <div class="contents">
46
                <div class="collector-default">
47
                    <p>Running<?=
7✔
48
                        class_exists('Aplus')
7✔
49
                            ? ' <a href="https://aplus-framework.com" target="_blank" class="aplus-link">Aplus</a> ' . Debugger::roundVersion(Aplus::VERSION)
×
50
                            : '' ?> on <?= \PHP_OS_FAMILY ?> with PHP
7✔
51
                        <?= Debugger::roundVersion(\PHP_VERSION) ?>.
7✔
52
                    </p>
53
                    <p>★
54
                        <?php if ($hasInfoLink): ?>
7✔
55
                            <a href="<?= htmlentities($options['info_link']['href']) ?>"
2✔
56
                               target="_blank"><?= htmlentities($options['info_link']['text']) ?>
2✔
57
                            </a>
2✔
58
                        <?php else: ?>
59
                            <a href="https://aplus-framework.com" target="_blank">aplus-framework.com</a>
5✔
60
                        <?php endif ?>
5✔
61
                    </p>
7✔
62
                    <?php
7✔
63
                $count = isset($activities['collected']) ? count($activities['collected']) : 0;
7✔
64
if ($count):
7✔
65
    ?>
66
                        <p><?= $count ?> activit<?= $count === 1
1✔
67
            ? 'y was'
1✔
68
            : 'ies were' ?> collected in <?= Debugger::roundSecondsToMilliseconds($activities['total']) ?> milliseconds:
1✔
69
                        </p>
70
                        <table>
71
                            <thead>
72
                            <tr>
73
                                <th>#</th>
74
                                <th>Collection</th>
75
                                <th>Collector</th>
76
                                <th>Description</th>
77
                                <th title="Milliseconds">Runtime</th>
78
                                <th title="Runtime percentages">
79
                                    <span>10%</span><span>20%</span><span>30%</span><span>40%</span>
80
                                    <span>50%</span><span>60%</span><span>70%</span><span>80%</span>
81
                                    <span>90%</span><span>100%</span>
82
                                </th>
83
                            </tr>
84
                            </thead>
85
                            <tbody>
86
                            <?php foreach ($activities['collected'] as $index => $collected): ?>
1✔
87
                                <tr>
1✔
88
                                    <td><?= $index + 1 ?></td>
1✔
89
                                    <td><?= htmlentities($collected['collection']) ?></td>
1✔
90
                                    <td title="<?= htmlentities($collected['class']) ?>"><?= htmlentities($collected['collector']) ?></td>
1✔
91
                                    <td><?= htmlentities($collected['description']) ?></td>
1✔
92
                                    <td><?= Debugger::roundSecondsToMilliseconds($collected['total']) ?></td>
1✔
93
                                    <td>
94
                                    <span style="width: <?= $collected['width'] ?>%; margin-left: <?=
1✔
95
                $collected['left']
1✔
96
                                ?>%" title="<?= $collected['width'] ?>% · From <?=
1✔
97
                                $collected['left'] ?>% to <?=
1✔
98
                                $collected['left'] + $collected['width'] ?>% · From <?=
1✔
99
                                round($collected['start'], 6) ?> to <?= round($collected['end'], 6) ?> second"></span>
1✔
100
                                    </td>
101
                                </tr>
102
                            <?php endforeach ?>
103
                            </tbody>
1✔
104
                        </table>
1✔
105
                    <?php
1✔
106
endif
107
?>
108
                </div>
7✔
109
            </div>
7✔
110
        </div>
7✔
111
        <?php foreach ($collections as $collection): ?>
7✔
112
            <?php if ($collection->hasCollectors()): ?>
2✔
113
                <div class="panel <?= $collection->getSafeName() ?>-collection">
2✔
114
                    <div class="resize" title="Change panel height"></div>
115
                    <header>
116
                        <div class="title">
117
                            <span class="title-icon"><?= $collection->getIcon() ?></span>
2✔
118
                            <span class="title-name"><?= $collection->getName() ?></span>
2✔
119
                        </div>
120
                        <div class="actions"><?= implode(' ', $collection->getActions()) ?></div>
2✔
121
                        <div class="collectors">
122
                            <?php
123
        $collectors = $collection->getCollectors();
2✔
124
                ?>
125
                            <select title="<?= $collection->getSafeName() ?> collectors"<?=
2✔
126
                count($collectors) === 1 ? ' disabled' : '' ?>>
2✔
127
                                <?php foreach ($collectors as $collector): ?>
2✔
128
                                    <option value="<?= $collector->getSafeName() ?>"><?= $collector->getName() ?></option>
2✔
129
                                <?php endforeach ?>
130
                            </select>
2✔
131
                        </div>
2✔
132
                    </header>
2✔
133
                    <div class="contents">
2✔
134
                        <?php foreach ($collection->getCollectors() as $collector): ?>
2✔
135
                            <div class="collector-<?= $collector->getSafeName() ?>"><?= $collector->getContents() ?></div>
2✔
136
                        <?php endforeach ?>
137
                    </div>
2✔
138
                </div>
2✔
139
            <?php endif ?>
2✔
140
        <?php endforeach ?>
2✔
141
    </div>
7✔
142
    <div class="toolbar">
7✔
143
        <div class="icon">
7✔
144
            <img src="data:image/png;base64,<?= base64_encode((string) file_get_contents($iconPath)) ?>" alt="A+" width="32" height="32">
7✔
145
        </div>
146
        <div class="collections">
147
            <?php foreach ($collections as $collection): ?>
7✔
148
                <?php if ($collection->hasCollectors()): ?>
2✔
149
                    <button class="collection" id="<?= $collection->getSafeName() ?>-collection"
2✔
150
                        title="<?= $collection->getName() ?> Collection">
2✔
151
                        <span class="collection-icon"><?= $collection->getIcon() ?></span>
2✔
152
                        <span class="collection-name"><?= $collection->getName() ?></span>
2✔
153
                    </button>
154
                <?php endif ?>
155
            <?php endforeach ?>
2✔
156
            <div class="info">
7✔
157
                <button class="collection" id="info-collection" title="Info Collection">
7✔
158
                    <span class="collection-icon"><?= $infoIcon ?></span>
7✔
159
                    <span class="collection-name">Info</span>
160
                </button>
161
            </div>
162
        </div>
163
    </div>
164
</div>
165
<script>
166
    window.Prism = {};
167
    Prism.manual = true;
168
    <?= file_get_contents(__DIR__ . '/../assets/prism.js') ?>
7✔
169
    Prism.highlightAllUnder(document.querySelector('#debugbar .panels'));
7✔
170
</script>
171
<script>
172
    <?= file_get_contents(__DIR__ . '/scripts.js') ?>
7✔
173
    Debugbar.init();
7✔
174
</script>
175
<!-- Aplus Framework Debugbar end -->
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc