Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
66.67% covered (warning)
66.67%
4 / 6
80.00% covered (warning)
80.00%
4 / 5
80.00% covered (warning)
80.00%
4 / 5
80.00% covered (warning)
80.00%
4 / 5
CRAP
0.00% covered (danger)
0.00%
0 / 1
BaseController
66.67% covered (warning)
66.67%
4 / 6
80.00% covered (warning)
80.00%
4 / 5
80.00% covered (warning)
80.00%
4 / 5
80.00% covered (warning)
80.00%
4 / 5
5.20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 logDebug
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 logInfo
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 logError
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 logWarning
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace App\Controller;
4
5use App\Menu\MenuBase;
6use App\Menu\MenuTwig;
7use Psr\Log\LoggerInterface;
8use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
9
10class BaseController extends AbstractController
11{
12    public MenuTwig $menuTwig;
13    protected LoggerInterface $logger;
14
15    public function __construct(MenuBase $menu, LoggerInterface $applicationLogger)
16    {
17        $this->menuTwig = $menu->menuTwig;
18        $this->logger = $applicationLogger;
19    }
20
21    /**
22     * Write a debug info in logger.
23     *
24     * @param mixed[] $context
25     */
26    public function logDebug(string $message, array $context = []): void
27    {
28        $this->logger->debug($message, $context);
29    }
30
31    /**
32     * Write an info in logger.
33     *
34     * @param mixed[] $context
35     */
36    public function logInfo(string $message, array $context = []): void
37    {
38        $this->logger->info($message, $context);
39    }
40
41    /**
42     * Write an error info in logger.
43     *
44     * @param mixed[] $context
45     */
46    public function logError(string $message, array $context = []): void
47    {
48        $this->logger->error($message, $context);
49    }
50
51    /**
52     * Write a warning info in logger.
53     *
54     * @param mixed[] $context
55     */
56    public function logWarning(string $message, array $context = []): void
57    {
58        $this->logger->warning($message, $context);
59    }
60}

Paths

Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once. Please also be aware that some paths may include implicit rather than explicit branches, e.g. an if statement always has an else as part of its logical flow even if you didn't write one.

BaseController->__construct
15    public function __construct(MenuBase $menu, LoggerInterface $applicationLogger)
16    {
17        $this->menuTwig = $menu->menuTwig;
18        $this->logger = $applicationLogger;
19    }
BaseController->logDebug
26    public function logDebug(string $message, array $context = []): void
27    {
28        $this->logger->debug($message, $context);
29    }
BaseController->logError
46    public function logError(string $message, array $context = []): void
47    {
48        $this->logger->error($message, $context);
49    }
BaseController->logInfo
36    public function logInfo(string $message, array $context = []): void
37    {
38        $this->logger->info($message, $context);
39    }
BaseController->logWarning
56    public function logWarning(string $message, array $context = []): void
57    {
58        $this->logger->warning($message, $context);
59    }