Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| WikibaseMediaInfoEntityLibrary | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| register | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Wikibase\MediaInfo\DataAccess\Scribunto; |
| 4 | |
| 5 | use Wikibase\Client\DataAccess\Scribunto\WikibaseEntityLibrary; |
| 6 | |
| 7 | /** |
| 8 | * Registers and defines functions to access WikibaseMediaInfo through the Scribunto extension |
| 9 | */ |
| 10 | class WikibaseMediaInfoEntityLibrary extends WikibaseEntityLibrary { |
| 11 | |
| 12 | /** |
| 13 | * Register the mw.wikibase.mediainfo.entity.lua library. |
| 14 | * |
| 15 | * @return array |
| 16 | */ |
| 17 | public function register() { |
| 18 | // These functions will be exposed to the Lua module. |
| 19 | // They are member functions on a Lua table which is private to the module, thus |
| 20 | // these can't be called from user code, unless explicitly exposed in Lua. |
| 21 | $lib = []; |
| 22 | |
| 23 | return $this->getEngine()->registerInterface( |
| 24 | __DIR__ . '/mw.wikibase.mediainfo.entity.lua', $lib, [] |
| 25 | ); |
| 26 | } |
| 27 | |
| 28 | } |