MockLogger   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 2
c 2
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A enhanceLogEntry() 0 2 1
A __construct() 0 1 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Drupal\Tests\mongodb_watchdog\Unit;
6
7
use Drupal\mongodb_watchdog\Logger;
8
9
// Disable PHPCS which incorrectly diagnoses a useless constructor.
10
// phpcs:disable
11
12
/**
13
 * Class MockLogger provides a Logger implementation usable in unit tests.
14
 *
15
 * Normal implementations would require a slower kernel Test.
16
 *
17
 * @package Drupal\Tests\mongodb_watchdog\Unit
18
 */
19
class MockLogger extends Logger {
20
21
  /**
22
   * TestLogger mock constructor.
23
   */
24
  public function __construct() {
25
    // This override avoids requiring actual services.
26
  }
27
28
  /**
29
   * {@inheritDoc}
30
   */
31
  public function enhanceLogEntry(array &$entry, array $backtrace): void {
32
    parent::enhanceLogEntry($entry, $backtrace);
33
  }
34
35
}
36