| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2.0054 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 2 | public function initialize_index_article(midcom_db_topic $topic) : net_nemein_wiki_wikipage |
|
| 29 | { |
||
| 30 | 2 | $page = new net_nemein_wiki_wikipage(); |
|
| 31 | 2 | $page->topic = $topic->id; |
|
| 32 | 2 | $page->name = 'index'; |
|
| 33 | 2 | $page->title = $topic->extra; |
|
| 34 | 2 | $page->content = $this->_l10n->get('wiki default page content'); |
|
| 35 | 2 | if (!$page->create()) { |
|
| 36 | throw new midcom_error('Failed to create index article: ' . midcom_connection::get_error_string()); |
||
| 37 | } |
||
| 38 | 2 | return $page; |
|
| 39 | } |
||
| 41 |