Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| EventSubmitter | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| submit | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Extension\EventLogging\MetricsPlatform; |
| 4 | |
| 5 | use MediaWiki\Extension\EventLogging\EventSubmitter\EventSubmitter as EventLoggingEventSubmitter; |
| 6 | use Wikimedia\MetricsPlatform\EventSubmitter as MetricsPlatformEventSubmitter; |
| 7 | |
| 8 | /** |
| 9 | * Adapts implementations of the EventLogging EventSubmitter interface to the equivalent Metrics |
| 10 | * Platform interface, thereby allowing them to vary independently. |
| 11 | */ |
| 12 | class EventSubmitter implements MetricsPlatformEventSubmitter { |
| 13 | |
| 14 | /** @var EventLoggingEventSubmitter */ |
| 15 | private $eventSubmitter; |
| 16 | |
| 17 | public function __construct( EventLoggingEventSubmitter $eventSubmitter ) { |
| 18 | $this->eventSubmitter = $eventSubmitter; |
| 19 | } |
| 20 | |
| 21 | /** @inheritDoc */ |
| 22 | public function submit( string $streamName, array $event ): void { |
| 23 | $this->eventSubmitter->submit( $streamName, $event ); |
| 24 | } |
| 25 | } |