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 | * IRenderer.php |
4 | * |
5 | * This file is part of the Codex PHP library, which provides a PHP-based interface for rendering |
6 | * UI components consistent with the Codex design system. The `IRenderer` interface defines |
7 | * the contract for rendering any UI component. Any class implementing this interface must provide |
8 | * a method to generate the HTML markup for a given component object. |
9 | * |
10 | * @category Contract\Renderer |
11 | * @package Codex\Contract\Renderer |
12 | * @since 0.1.0 |
13 | * @author Doğu Abaris <abaris@null.net> |
14 | * @license https://www.gnu.org/copyleft/gpl.html GPL-2.0-or-later |
15 | * @link https://doc.wikimedia.org/codex/main/ Codex Documentation |
16 | */ |
17 | |
18 | namespace Wikimedia\Codex\Contract\Renderer; |
19 | |
20 | /** |
21 | * IRenderer defines the interface for rendering any component. |
22 | * |
23 | * Any class that implements this interface must provide the `render` method, |
24 | * which takes a Component object and returns the corresponding HTML markup as a string. |
25 | * |
26 | * @category Contract\Renderer |
27 | * @package Codex\Contract\Renderer |
28 | * @since 0.1.0 |
29 | * @author Doğu Abaris <abaris@null.net> |
30 | * @license https://www.gnu.org/copyleft/gpl.html GPL-2.0-or-later |
31 | * @link https://doc.wikimedia.org/codex/main/ Codex Documentation |
32 | */ |
33 | interface IRenderer { |
34 | /** |
35 | * Renders the HTML markup for a Component. |
36 | * |
37 | * This method is responsible for generating the complete HTML markup for the provided |
38 | * component object. The implementation should ensure that the generated markup is |
39 | * consistent with the Codex design system's guidelines. |
40 | * |
41 | * @since 0.1.0 |
42 | * @param mixed $component The Component object to render. |
43 | * @return string The generated HTML markup for the component. |
44 | */ |
45 | public function render( $component ): string; |
46 | } |