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 | /** |
| 4 | * The main Plugin interface |
| 5 | * |
| 6 | * This Source Code Form is subject to the terms of the Mozilla Public License, |
| 7 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
| 8 | * obtain one at https://mozilla.org/MPL/2.0/. |
| 9 | * |
| 10 | * @package phpMyFAQ |
| 11 | * @author Thorsten Rinne <thorsten@phpmyfaq.de> |
| 12 | * @copyright 2024-2026 phpMyFAQ Team |
| 13 | * @license https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
| 14 | * @link https://www.phpmyfaq.de |
| 15 | * @since 2024-07-10 |
| 16 | */ |
| 17 | |
| 18 | declare(strict_types=1); |
| 19 | |
| 20 | namespace phpMyFAQ\Plugin; |
| 21 | |
| 22 | use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
| 23 | |
| 24 | interface PluginInterface |
| 25 | { |
| 26 | /** |
| 27 | * Returns the name of the plugin |
| 28 | */ |
| 29 | public function getName(): string; |
| 30 | |
| 31 | /** |
| 32 | * Returns the version of the plugin |
| 33 | */ |
| 34 | public function getVersion(): string; |
| 35 | |
| 36 | /** |
| 37 | * Returns the description of the plugin |
| 38 | */ |
| 39 | public function getDescription(): string; |
| 40 | |
| 41 | /** |
| 42 | * Returns the author of the plugin |
| 43 | */ |
| 44 | public function getAuthor(): string; |
| 45 | |
| 46 | /** |
| 47 | * Returns the dependencies of the plugin |
| 48 | * |
| 49 | * @return string[] |
| 50 | */ |
| 51 | public function getDependencies(): array; |
| 52 | |
| 53 | /** |
| 54 | * Returns the configuration of the plugin (optional) |
| 55 | */ |
| 56 | public function getConfig(): ?PluginConfigurationInterface; |
| 57 | |
| 58 | /** |
| 59 | * Register the events |
| 60 | */ |
| 61 | public function registerEvents(EventDispatcherInterface $eventDispatcher): void; |
| 62 | |
| 63 | /** |
| 64 | * Returns an array of CSS file paths (relative to plugin directory) |
| 65 | * Plugins should provide pre-compiled CSS files |
| 66 | * |
| 67 | * @return string[] Array of CSS file paths, e.g., ['assets/style.css'] |
| 68 | */ |
| 69 | public function getStylesheets(): array; |
| 70 | |
| 71 | /** |
| 72 | * Returns the path to the translations directory (relative to plugin directory) |
| 73 | * Returns null if the plugin doesn't provide translations |
| 74 | * |
| 75 | * @return string|null Path to the translations directory, e.g., 'translations' |
| 76 | */ |
| 77 | public function getTranslationsPath(): ?string; |
| 78 | |
| 79 | /** |
| 80 | * Returns an array of JavaScript file paths (relative to plugin directory) |
| 81 | * Plugins should provide pre-compiled JavaScript files (not TypeScript source) |
| 82 | * |
| 83 | * @return string[] Array of JavaScript file paths, e.g., ['assets/script.js'] |
| 84 | */ |
| 85 | public function getScripts(): array; |
| 86 | } |