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

Cecilapp / Cecil / 15789667681

20 Jun 2025 11:43PM UTC coverage: 82.623%. Remained the same
15789667681

push

github

ArnaudLigny
doc: better API doc

3119 of 3775 relevant lines covered (82.62%)

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

12
declare(strict_types=1);
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
/**
22
 * TwigCacheRuntimeLoader class.
23
 *
24
 * This class implements the RuntimeLoaderInterface to provide a CacheRuntime instance
25
 * for Twig, using a FilesystemAdapter for caching.
26
 */
27
class TwigCacheRuntimeLoader implements RuntimeLoaderInterface
28
{
29
    /**
30
     * Directory where cache files are stored.
31
     * @var string
32
     */
33
    protected string $cacheDir;
34

35
    public function __construct(string $cacheDir)
36
    {
37
        $this->cacheDir = $cacheDir;
1✔
38
    }
39

40
    public function load(string $class)
41
    {
42
        if (CacheRuntime::class === $class) {
1✔
43
            return new CacheRuntime(new TagAwareAdapter(new FilesystemAdapter(namespace: '_fragments', directory: $this->cacheDir)));
1✔
44
        }
45

46
        return null;
×
47
    }
48
}
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