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

heimrichhannot / contao-encore-bundle / 24707431038

21 Apr 2026 06:23AM UTC coverage: 70.185% (-2.9%) from 73.04%
24707431038

Pull #35

github

web-flow
Merge e91f4dd07 into 478505309
Pull Request #35: Add symfony debug bar support

1 of 31 new or added lines in 3 files covered. (3.23%)

1 existing line in 1 file now uncovered.

532 of 758 relevant lines covered (70.18%)

1.95 hits per line

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

0.0
/src/DataCollector/EncoreCollector.php
1
<?php
2

3
namespace HeimrichHannot\EncoreBundle\DataCollector;
4

5
use Composer\InstalledVersions;
6
use HeimrichHannot\EncoreBundle\Collection\ExtensionCollection;
7
use HeimrichHannot\EncoreBundle\EntryPoint\EntryPoints;
8
use Symfony\Bundle\FrameworkBundle\DataCollector\AbstractDataCollector;
9
use Symfony\Component\HttpFoundation\Request;
10
use Symfony\Component\HttpFoundation\Response;
11

12
class EncoreCollector extends AbstractDataCollector
13
{
14
    public function __construct(
15
        private readonly ExtensionCollection $extensionCollection,
16
    ) {
NEW
17
    }
×
18

19
    public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
20
    {
NEW
21
        if ($request->attributes->has('encore_entries')) {
×
NEW
22
            $entryPoints = $request->attributes->get('encore_entries');
×
NEW
23
            if (!($entryPoints instanceof EntryPoints)) {
×
NEW
24
                $this->data['enabled'] = false;
×
25

NEW
26
                return;
×
27
            }
28

NEW
29
            $this->data['entries'] = $entryPoints->all();
×
NEW
30
            $this->data['enabled'] = true;
×
31
        } else {
NEW
32
            $this->data['enabled'] = false;
×
33
        }
34

NEW
35
        $extensions = $this->extensionCollection->getExtensions();
×
NEW
36
        $extensionEntries = [];
×
NEW
37
        foreach ($extensions as $extension) {
×
NEW
38
            $reflection = new \ReflectionClass($extension->getBundle());
×
NEW
39
            $extensionEntries[] = [
×
NEW
40
                'name' => $reflection->getShortName(),
×
NEW
41
                'entries' => $extension->getEntries(),
×
NEW
42
            ];
×
43
        }
44

NEW
45
        $this->data['extensions'] = $extensionEntries;
×
46
    }
47

48
    public static function getTemplate(): ?string
49
    {
NEW
50
        return '@Contao/data_collector/huh_encore.html.twig';
×
51
    }
52

53
    public function isEnabled(): bool
54
    {
NEW
55
        return $this->data['enabled'] ?? false;
×
56
    }
57

58
    public function getEntries(): array
59
    {
NEW
60
        return $this->data['entries'] ?? [];
×
61
    }
62

63
    public function getVersion(): string
64
    {
NEW
65
        return InstalledVersions::getPrettyVersion('heimrichhannot/contao-encore-bundle');
×
66
    }
67

68
    public function getExtensions(): array
69
    {
NEW
70
        return $this->data['extensions'] ?? [];
×
71
    }
72
}
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