MockLogger::enhanceLogEntry()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 2
rs 10
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