| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 90% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | class EscapingEntityIdFormatter implements EntityIdFormatter { |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var EntityIdFormatter |
||
| 21 | */ |
||
| 22 | private $formatter; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var callable |
||
| 26 | */ |
||
| 27 | private $escapeCallback; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param EntityIdFormatter $formatter A formatter returning plain text. |
||
| 31 | * @param callable $escapeCallback A callable taking plain text and returning escaped text. |
||
| 32 | * |
||
| 33 | * @throws InvalidArgumentException |
||
| 34 | 1 | */ |
|
| 35 | 1 | public function __construct( EntityIdFormatter $formatter, $escapeCallback ) { |
|
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @see EntityIdFormatter::formatEntityId |
||
| 46 | * |
||
| 47 | * @param EntityId $value |
||
| 48 | * |
||
| 49 | 1 | * @return string Typically wikitext or HTML, depending on the $escapeCallback provided. |
|
| 50 | 1 | */ |
|
| 51 | 1 | public function formatEntityId( EntityId $value ) { |
|
| 58 |