Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace GrowthExperiments\DashboardModule; |
4 | |
5 | interface IDashboardModule { |
6 | public const RENDER_DESKTOP = 'desktop'; |
7 | public const RENDER_MOBILE_SUMMARY = 'mobile-summary'; |
8 | public const RENDER_MOBILE_DETAILS = 'mobile-details'; |
9 | public const RENDER_MOBILE_DETAILS_OVERLAY = 'mobile-overlay'; |
10 | |
11 | /** |
12 | * Render the module in the given mode. |
13 | * |
14 | * @param string $mode One of RENDER_* constants |
15 | * @return string Html rendering of the module |
16 | */ |
17 | public function render( $mode ); |
18 | |
19 | /** |
20 | * Get an array of data needed by the Javascript code related to this module. |
21 | * |
22 | * The default implementation doesn't return anything. |
23 | * |
24 | * @param string $mode One of RENDER_* constants |
25 | * @return array |
26 | */ |
27 | public function getJsData( $mode ); |
28 | |
29 | /** |
30 | * Whether this module supports the given mode. If this returns false, render() and |
31 | * getJsData() should not be called with this mode. |
32 | * @param string $mode One of RENDER_* constants |
33 | * @return bool |
34 | */ |
35 | public function supports( $mode ); |
36 | } |