Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
66.67% covered (warning)
66.67%
2 / 3
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
TrivialMediaHandlerState
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 getHandlerState
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setHandlerState
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace MediaWiki\Media;
4
5/**
6 * Trivial implementation of MediaHandlerState.
7 *
8 * @since 1.37
9 */
10class TrivialMediaHandlerState implements MediaHandlerState {
11    /** @var array */
12    private $state = [];
13
14    /** @inheritDoc */
15    public function getHandlerState( string $key ) {
16        return $this->state[$key] ?? null;
17    }
18
19    /** @inheritDoc */
20    public function setHandlerState( string $key, $value ) {
21        $this->state[$key] = $value;
22    }
23}
24
25/** @deprecated class alias since 1.46 */
26class_alias( TrivialMediaHandlerState::class, 'TrivialMediaHandlerState' );