Conditions | 4 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | private static function doSmwCheck(): void { |
||
16 | if ( !defined( 'SMW_VERSION' ) ) { |
||
17 | |||
18 | if ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' ) { |
||
19 | die( "\nThe 'Modern Timeline' extension requires 'Semantic MediaWiki' to be installed and enabled.\n" ); |
||
|
|||
20 | } |
||
21 | |||
22 | die( |
||
23 | '<b>Error:</b> The <a href="https://professional.wiki/en/extension/modern-timeline">Modern Timeline</a> ' . |
||
24 | 'extension requires <a href="https://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki">Semantic MediaWiki</a> to be ' . |
||
25 | 'installed and enabled.<br />' |
||
26 | ); |
||
31 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.