Passed
Push — master ( d7fd6a...9124ff )
by Robbie
11:58
created

CwpCommentingExtension   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A alterCommentForm() 0 14 3
1
<?php
2
3
/**
4
 * Customises the comment form to conform to government usability standards
5
 *
6
 * {@see CommentingController}
7
 */
8
class CwpCommentingExtension extends Extension {
9
	public function alterCommentForm(Form $form) {
10
		$fields = $form->Fields();
11
12
13
		if ($emailField = $fields->dataFieldByName('Email')) {
14
			$emailField
15
				->setTitle(_t('CwpCommentingExtension.EMAIL_TITLE', 'Email'))
16
				->setDescription(_t('CwpCommentingExtension.WILL_NOT_BE_PUBLISHED', 'Will not be published.'));
17
		}
18
19
		if ($urlField = $fields->dataFieldByName('URL')) {
20
			$urlField
21
				->setTitle(_t('CwpCommentingExtension.WEBSITE_TITLE', 'Your website (optional)'))
22
				->setAttribute('placeholder', 'http://');
23
		}
24
	}
25
}
26