Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Failed Conditions
Pull Request — main (#1494)
by Dan
08:06 queued 03:15
created

NewsletterSend   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
dl 0
loc 28
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 24 2
1
<?php declare(strict_types=1);
2
3
namespace Smr\Pages\Admin;
4
5
use Smr\Database;
6
use Smr\Page\AccountPage;
7
use Smr\Template;
8
use SmrAccount;
9
10
class NewsletterSend extends AccountPage {
11
12
	public string $file = 'admin/newsletter_send.php';
13
14
	public function build(SmrAccount $account, Template $template): void {
15
		$template->assign('PageTopic', 'Newsletter');
16
17
		$template->assign('CurrentEmail', $account->getEmail());
18
19
		// Get the most recent newsletter text for preview
20
		$db = Database::getInstance();
21
		$dbResult = $db->read('SELECT newsletter_id, newsletter_html, newsletter_text FROM newsletter ORDER BY newsletter_id DESC LIMIT 1');
22
		if ($dbResult->hasRecord()) {
23
			$dbRecord = $dbResult->record();
24
			$id = $dbRecord->getInt('newsletter_id');
25
			$template->assign('NewsletterId', $id);
26
			$template->assign('DefaultSubject', 'Space Merchant Realms Newsletter #' . $id);
27
28
			// Give both the template and processing container access to the message
29
			$processingContainer = new NewsletterSendProcessor(
30
				newsletterHtml: $dbRecord->getString('newsletter_html'),
31
				newsletterText: $dbRecord->getString('newsletter_text'),
32
			);
33
			$template->assign('NewsletterHtml', $dbRecord->getString('newsletter_html'));
34
			$template->assign('NewsletterText', $dbRecord->getString('newsletter_text'));
35
36
			// Create the form for the populated processing container
37
			$template->assign('ProcessingHREF', $processingContainer->href());
38
		}
39
	}
40
41
}
42