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

tempestphp / tempest-framework / 14024978163

23 Mar 2025 05:55PM UTC coverage: 79.391% (-0.05%) from 79.441%
14024978163

push

github

web-flow
feat(view): cache Blade and Twig templates in internal storage (#1061)

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

912 existing lines in 110 files now uncovered.

10478 of 13198 relevant lines covered (79.39%)

91.09 hits per line

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

90.0
/src/Tempest/Container/src/Exceptions/CannotInstantiateDependencyException.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Container\Exceptions;
6

7
use Exception;
8
use Tempest\Container\DependencyChain;
9
use Tempest\Reflection\ClassReflector;
10

11
final class CannotInstantiateDependencyException extends Exception implements ContainerException
12
{
13
    public function __construct(ClassReflector $class, DependencyChain $chain)
661✔
14
    {
15
        $message = "Cannot resolve {$class->getName()} because it is not an instantiable class. Maybe it's missing an initializer class?" . PHP_EOL;
661✔
16

17
        $stack = $chain->all();
661✔
18

19
        if ($stack === []) {
661✔
20
            parent::__construct($message);
2✔
21

22
            return;
2✔
23
        }
24

25
        $i = 0;
659✔
26

27
        foreach ($stack as $currentDependency) {
659✔
28
            $pipe = match (true) {
659✔
29
                count($stack) > 1 && $i === 0 => '┌──',
659✔
30
                count($stack) > 1 && $i === (count($stack) - 1) => '└──',
659✔
UNCOV
31
                count($stack) === 1 => '   ',
×
32
                default => '├──',
×
33
            };
659✔
34

35
            $message .= PHP_EOL . "\t{$pipe} " . $currentDependency->getShortName();
659✔
36

37
            $i++;
659✔
38
        }
39

40
        $lastDependency = $chain->last();
659✔
41
        //        $currentDependencyName = $lastDependency->getShortName();
42
        //        $firstPart = explode($currentDependencyName, (string)$lastDependency)[0] ?? null;
43
        //        $fillerSpaces = str_repeat(' ', strlen($firstPart) + 3);
44
        //        $fillerArrows = str_repeat('▒', strlen($currentDependencyName));
45
        //        $message .= PHP_EOL . "\t {$fillerSpaces}{$fillerArrows}";
46
        //        $message .= PHP_EOL . PHP_EOL;
47

48
        $message .= "Originally called in {$chain->getOrigin()}";
659✔
49
        $message .= PHP_EOL;
659✔
50

51
        parent::__construct($message);
659✔
52
    }
53
}
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