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

tempestphp / tempest-framework / 14049246919

24 Mar 2025 09:42PM UTC coverage: 79.353% (-0.04%) from 79.391%
14049246919

push

github

web-flow
feat(support): support array parameters in string manipulations (#1073)

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

735 existing lines in 126 files now uncovered.

10492 of 13222 relevant lines covered (79.35%)

90.78 hits per line

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

0.0
/src/Tempest/Router/src/HttpApplication.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Router;
6

7
use Tempest\Container\Container;
8
use Tempest\Container\Singleton;
9
use Tempest\Core\AppConfig;
10
use Tempest\Core\Application;
11
use Tempest\Core\Kernel;
12
use Tempest\Core\Tempest;
13
use Tempest\Log\Channels\AppendLogChannel;
14
use Tempest\Log\LogConfig;
15
use Tempest\Router\Session\Session;
16
use Throwable;
17

18
use function Tempest\env;
19
use function Tempest\Support\path;
20

21
#[Singleton]
22
final readonly class HttpApplication implements Application
23
{
24
    public function __construct(
×
25
        private Container $container,
UNCOV
26
    ) {}
×
27

28
    /** @param \Tempest\Discovery\DiscoveryLocation[] $discoveryLocations */
UNCOV
29
    public static function boot(
×
30
        string $root,
31
        array $discoveryLocations = [],
32
    ): self {
UNCOV
33
        $container = Tempest::boot($root, $discoveryLocations);
×
34

UNCOV
35
        $application = $container->get(HttpApplication::class);
×
36

37
        // Application-specific setup
UNCOV
38
        $logConfig = $container->get(LogConfig::class);
×
39

UNCOV
40
        if ($logConfig->debugLogPath === null && $logConfig->serverLogPath === null && $logConfig->channels === []) {
×
41
            $logConfig->debugLogPath = path($container->get(Kernel::class)->root, '/log/debug.log')->toString();
×
42
            $logConfig->serverLogPath = env('SERVER_LOG');
×
43
            $logConfig->channels[] = new AppendLogChannel(path($root, '/log/tempest.log')->toString());
×
44
        }
45

UNCOV
46
        return $application;
×
47
    }
48

UNCOV
49
    public function run(): void
×
50
    {
51
        try {
UNCOV
52
            $router = $this->container->get(Router::class);
×
53

UNCOV
54
            $psrRequest = $this->container->get(RequestFactory::class)->make();
×
55

UNCOV
56
            $responseSender = $this->container->get(ResponseSender::class);
×
57

UNCOV
58
            $responseSender->send(
×
59
                $router->dispatch($psrRequest),
×
60
            );
×
61

UNCOV
62
            $this->container->get(Session::class)->cleanup();
×
63

UNCOV
64
            $this->container->get(Kernel::class)->shutdown();
×
65
        } catch (Throwable $throwable) {
×
66
            foreach ($this->container->get(AppConfig::class)->errorHandlers as $exceptionHandler) {
×
67
                $exceptionHandler->handleException($throwable);
×
68
            }
69

UNCOV
70
            throw $throwable;
×
71
        }
72
    }
73
}
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