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

aplus-framework / debug / 5710546349

pending completion
5710546349

push

github

natanfelles
Add Debugger::roundVersion method

10 of 10 new or added lines in 2 files covered. (100.0%)

513 of 515 relevant lines covered (99.61%)

2.61 hits per line

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

98.95
/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
?>
11
<!-- Aplus Framework Debugbar start -->
3✔
12
<style>
3✔
13
    <?= file_get_contents(__DIR__ . '/../assets/prism-aplus.css') ?>
3✔
14
</style>
3✔
15
<style>
3✔
16
    <?php
3✔
17
    $contents = file_get_contents(__DIR__ . '/styles.css');
3✔
18
if (isset($options['color'])) {
3✔
19
    $contents = strtr($contents, ['magenta' => $options['color']]); // @phpstan-ignore-line
1✔
20
}
21
echo $contents;
3✔
22
?>
23
</style>
3✔
24
<div id="debugbar" class="aplus-debug">
3✔
25
    <div class="panels">
3✔
26
        <div class="panel info-collection">
3✔
27
            <div class="resize"></div>
3✔
28
            <header>
3✔
29
                <div class="title">Info</div>
3✔
30
            </header>
3✔
31
            <div class="contents">
3✔
32
                <div class="collector-default">
3✔
33
                    <p>Running<?=
3✔
34
                        class_exists('Aplus')
3✔
35
                            ? ' Aplus ' . Debugger::roundVersion(Aplus::VERSION)
×
36
                            : '' ?> on <?= \PHP_OS_FAMILY ?> with PHP
3✔
37
                        <?= Debugger::roundVersion(\PHP_VERSION) ?>
3✔
38
                    </p>
3✔
39
                    <p>★
40
                        <a href="https://aplus-framework.com" target="_blank">aplus-framework.com</a>
41
                    </p>
42
                    <?php
43
                $count = isset($activities['collected']) ? count($activities['collected']) : 0;
3✔
44
if ($count):
3✔
45
    ?>
46
                        <p><?= $count ?> activit<?= $count === 1
1✔
47
            ? 'y was'
1✔
48
            : 'ies were' ?> collected in <?= round($activities['total'], 6) ?> seconds:
1✔
49
                        </p>
50
                        <table>
51
                            <thead>
52
                            <tr>
53
                                <th>#</th>
54
                                <th>Collection</th>
55
                                <th>Collector</th>
56
                                <th>Description</th>
57
                                <th title="Seconds">Runtime</th>
58
                                <th title="Runtime percentages">
59
                                    <span>10%</span><span>20%</span><span>30%</span><span>40%</span>
60
                                    <span>50%</span><span>60%</span><span>70%</span><span>80%</span>
61
                                    <span>90%</span><span>100%</span>
62
                                </th>
63
                            </tr>
64
                            </thead>
65
                            <tbody>
66
                            <?php foreach ($activities['collected'] as $index => $collected): ?>
1✔
67
                                <tr>
1✔
68
                                    <td><?= $index + 1 ?></td>
1✔
69
                                    <td><?= htmlentities($collected['collection']) ?></td>
1✔
70
                                    <td title="<?= htmlentities($collected['class']) ?>"><?= htmlentities($collected['collector']) ?></td>
1✔
71
                                    <td><?= htmlentities($collected['description']) ?></td>
1✔
72
                                    <td><?= round($collected['total'], 6) ?></td>
1✔
73
                                    <td>
74
                                    <span style="width: <?= $collected['width'] ?>%; margin-left: <?=
1✔
75
                $collected['left']
1✔
76
                                ?>%" title="<?= $collected['width'] ?>% · From <?=
1✔
77
                                $collected['left'] ?>% to <?=
1✔
78
                                $collected['left'] + $collected['width'] ?>% · From <?=
1✔
79
                                round($collected['start'], 6) ?> to <?= round($collected['end'], 6) ?> second"></span>
1✔
80
                                    </td>
81
                                </tr>
82
                            <?php endforeach ?>
83
                            </tbody>
1✔
84
                        </table>
1✔
85
                    <?php
1✔
86
endif
87
?>
88
                </div>
3✔
89
            </div>
3✔
90
        </div>
3✔
91
        <?php foreach ($collections as $collection): ?>
3✔
92
            <?php if ($collection->hasCollectors()): ?>
2✔
93
                <div class="panel <?= $collection->getSafeName() ?>-collection">
2✔
94
                    <div class="resize"></div>
95
                    <header>
96
                        <div class="title"><?= $collection->getName() ?></div>
2✔
97
                        <div class="actions"><?= implode(' ', $collection->getActions()) ?></div>
2✔
98
                        <div class="collectors">
99
                            <?php
100
        $collectors = $collection->getCollectors();
2✔
101
                ?>
102
                            <select title="<?= $collection->getSafeName() ?> collectors"<?=
2✔
103
                count($collectors) === 1 ? ' disabled' : '' ?>>
2✔
104
                                <?php foreach ($collectors as $collector): ?>
2✔
105
                                    <option value="<?= $collector->getSafeName() ?>"><?= $collector->getName() ?></option>
2✔
106
                                <?php endforeach ?>
107
                            </select>
2✔
108
                        </div>
2✔
109
                    </header>
2✔
110
                    <div class="contents">
2✔
111
                        <?php foreach ($collection->getCollectors() as $collector): ?>
2✔
112
                            <div class="collector-<?= $collector->getSafeName() ?>"><?= $collector->getContents() ?></div>
2✔
113
                        <?php endforeach ?>
114
                    </div>
2✔
115
                </div>
2✔
116
            <?php endif ?>
2✔
117
        <?php endforeach ?>
2✔
118
    </div>
3✔
119
    <div class="toolbar">
3✔
120
        <div class="icon">
3✔
121
            <img src="data:image/png;base64,<?= base64_encode((string) file_get_contents(__DIR__ . '/icon.png')) ?>" alt="A+" width="32">
3✔
122
        </div>
123
        <div class="collections">
124
            <?php foreach ($collections as $collection): ?>
3✔
125
                <?php if ($collection->hasCollectors()): ?>
2✔
126
                    <button class="collection" id="<?= $collection->getSafeName() ?>-collection"><?= $collection->getName() ?></button>
2✔
127
                <?php endif ?>
128
            <?php endforeach ?>
2✔
129
            <div class="info">
3✔
130
                <button class="collection" id="info-collection">Info</button>
3✔
131
            </div>
3✔
132
        </div>
3✔
133
    </div>
3✔
134
</div>
3✔
135
<script>
3✔
136
    window.Prism = {};
3✔
137
    Prism.manual = true;
3✔
138
    <?= file_get_contents(__DIR__ . '/../assets/prism.js') ?>
3✔
139
    Prism.highlightAllUnder(document.querySelector('#debugbar .panels'));
3✔
140
</script>
3✔
141
<script>
3✔
142
    <?= file_get_contents(__DIR__ . '/scripts.js') ?>
3✔
143
    Debugbar.init();
3✔
144
</script>
3✔
145
<!-- Aplus Framework Debugbar end -->
3✔
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

© 2026 Coveralls, Inc