We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 4 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 16 | public function build(AbstractSmrPlayer $player): never { |
||
| 17 | $db = Database::getInstance(); |
||
| 18 | // Should we delete this paper? |
||
| 19 | if (Request::get('action') == 'Yes') { |
||
| 20 | |||
| 21 | // Should the articles associated with the paper be deleted as well? |
||
| 22 | if (Request::get('delete_articles') == 'Yes') { |
||
| 23 | $dbResult = $db->read('SELECT * FROM galactic_post_paper_content WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND paper_id = ' . $db->escapeNumber($this->paperID)); |
||
| 24 | foreach ($dbResult->records() as $dbRecord) { |
||
| 25 | $db->write('DELETE FROM galactic_post_article WHERE article_id = ' . $db->escapeNumber($dbRecord->getInt('article_id')) . ' AND game_id = ' . $db->escapeNumber($player->getGameID())); |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | // Delete the paper and the article associations |
||
| 30 | $db->write('DELETE FROM galactic_post_paper WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND paper_id = ' . $db->escapeNumber($this->paperID)); |
||
| 31 | $db->write('DELETE FROM galactic_post_paper_content WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND paper_id = ' . $db->escapeNumber($this->paperID)); |
||
| 32 | } |
||
| 33 | |||
| 34 | $container = new EditorOptions(); |
||
| 35 | $container->go(); |
||
| 36 | } |
||
| 39 |