| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function is_enableable() |
||
| 19 | { |
||
| 20 | // Requires phpBB 3.2.0 or newer. |
||
| 21 | $is_enableable = phpbb_version_compare(PHPBB_VERSION, '3.2.0', '>='); |
||
| 22 | |||
| 23 | // Display a custom warning message if requirement fails. |
||
| 24 | if (!$is_enableable) |
||
| 25 | { |
||
| 26 | $lang = $this->container->get('language'); |
||
| 27 | $lang->add_lang('tip_acp', 'vse/TopicImagePreview'); |
||
| 28 | |||
| 29 | // Suppress the error in case of CLI usage |
||
| 30 | @trigger_error($lang->lang('ACP_TIP_INSTALL_ERROR'), E_USER_WARNING); |
||
|
|
|||
| 31 | } |
||
| 32 | |||
| 33 | return $is_enableable; |
||
| 34 | } |
||
| 35 | } |
||
| 36 |
If you suppress an error, we recommend checking for the error condition explicitly: