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

Cecilapp / Cecil / 13786562850

11 Mar 2025 11:08AM UTC coverage: 82.938% (-0.5%) from 83.394%
13786562850

push

github

web-flow
Merge pull request #2133 from Cecilapp/cache

feat: better cache and Twig cache fragments

106 of 124 new or added lines in 11 files covered. (85.48%)

23 existing lines in 6 files now uncovered.

2970 of 3581 relevant lines covered (82.94%)

0.83 hits per line

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

75.0
/src/Renderer/TwigCacheRuntimeLoader.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of Cecil.
7
 *
8
 * Copyright (c) Arnaud Ligny <arnaud@ligny.fr>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13

14
namespace Cecil\Renderer;
15

16
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
17
use Symfony\Component\Cache\Adapter\TagAwareAdapter;
18
use Twig\Extra\Cache\CacheRuntime;
19
use Twig\RuntimeLoader\RuntimeLoaderInterface;
20

21
class TwigCacheRuntimeLoader implements RuntimeLoaderInterface
22
{
23
    protected string $cacheDir;
24

25
    public function __construct(string $cacheDir)
26
    {
27
        $this->cacheDir = $cacheDir;
1✔
28
    }
29

30
    public function load(string $class)
31
    {
32
        if (CacheRuntime::class === $class) {
1✔
33
            return new CacheRuntime(new TagAwareAdapter(new FilesystemAdapter(namespace: '_fragments', directory: $this->cacheDir)));
1✔
34
        }
35

NEW
36
        return null;
×
37
    }
38
}
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