Completed
Branch newinternal (6027bd)
by Simon
06:03
created

TaskBase::setIdentificationVerifier()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace Waca\Tasks;
4
5
use Waca\Helpers\HttpHelper;
6
use Waca\Helpers\Interfaces\IEmailHelper;
7
use Waca\Helpers\Interfaces\IOAuthHelper;
8
use Waca\Helpers\IrcNotificationHelper;
9
use Waca\Helpers\WikiTextHelper;
10
use Waca\PdoDatabase;
11
use Waca\Providers\Interfaces\IAntiSpoofProvider;
12
use Waca\Providers\Interfaces\ILocationProvider;
13
use Waca\Providers\Interfaces\IRDnsProvider;
14
use Waca\Providers\Interfaces\IXffTrustProvider;
15
use Waca\SiteConfiguration;
16
17
abstract class TaskBase implements ITask
18
{
19
	/** @var SiteConfiguration */
20
	private $siteConfiguration;
21
	/** @var IEmailHelper */
22
	private $emailHelper;
23
	/** @var HttpHelper */
24
	private $httpHelper;
25
	/** @var WikiTextHelper */
26
	private $wikiTextHelper;
27
	/** @var ILocationProvider */
28
	private $locationProvider;
29
	/** @var IXffTrustProvider */
30
	private $xffTrustProvider;
31
	/** @var IRDnsProvider */
32
	private $rdnsProvider;
33
	/** @var IAntiSpoofProvider */
34
	private $antiSpoofProvider;
35
	/** @var IOAuthHelper */
36
	private $oauthHelper;
37
	/** @var PdoDatabase */
38
	private $database;
39
	/** @var IrcNotificationHelper */
40
	private $notificationHelper;
41
42
	/**
43
	 * @return IEmailHelper
44
	 */
45
	final public function getEmailHelper()
46
	{
47
		return $this->emailHelper;
48
	}
49
50
	/**
51
	 * @param IEmailHelper $emailHelper
52
	 */
53
	final public function setEmailHelper($emailHelper)
54
	{
55
		$this->emailHelper = $emailHelper;
56
	}
57
58
	/**
59
	 * @return HttpHelper
60
	 */
61
	final public function getHttpHelper()
62
	{
63
		return $this->httpHelper;
64
	}
65
66
	/**
67
	 * @param HttpHelper $httpHelper
68
	 */
69
	final public function setHttpHelper($httpHelper)
70
	{
71
		$this->httpHelper = $httpHelper;
72
	}
73
74
	/**
75
	 * @return WikiTextHelper
76
	 */
77
	final public function getWikiTextHelper()
78
	{
79
		return $this->wikiTextHelper;
80
	}
81
82
	/**
83
	 * @param WikiTextHelper $wikiTextHelper
84
	 */
85
	final public function setWikiTextHelper($wikiTextHelper)
86
	{
87
		$this->wikiTextHelper = $wikiTextHelper;
88
	}
89
90
	/**
91
	 * @return ILocationProvider
92
	 */
93
	final public function getLocationProvider()
94
	{
95
		return $this->locationProvider;
96
	}
97
98
	/**
99
	 * @param ILocationProvider $locationProvider
100
	 */
101
	final public function setLocationProvider(ILocationProvider $locationProvider)
102
	{
103
		$this->locationProvider = $locationProvider;
104
	}
105
106
	/**
107
	 * @return IXffTrustProvider
108
	 */
109
	final public function getXffTrustProvider()
110
	{
111
		return $this->xffTrustProvider;
112
	}
113
114
	/**
115
	 * @param IXffTrustProvider $xffTrustProvider
116
	 */
117
	final public function setXffTrustProvider(IXffTrustProvider $xffTrustProvider)
118
	{
119
		$this->xffTrustProvider = $xffTrustProvider;
120
	}
121
122
	/**
123
	 * @return IRDnsProvider
124
	 */
125
	final public function getRdnsProvider()
126
	{
127
		return $this->rdnsProvider;
128
	}
129
130
	/**
131
	 * @param IRDnsProvider $rdnsProvider
132
	 */
133
	public function setRdnsProvider($rdnsProvider)
134
	{
135
		$this->rdnsProvider = $rdnsProvider;
136
	}
137
138
	/**
139
	 * @return IAntiSpoofProvider
140
	 */
141
	public function getAntiSpoofProvider()
142
	{
143
		return $this->antiSpoofProvider;
144
	}
145
146
	/**
147
	 * @param IAntiSpoofProvider $antiSpoofProvider
148
	 */
149
	public function setAntiSpoofProvider($antiSpoofProvider)
150
	{
151
		$this->antiSpoofProvider = $antiSpoofProvider;
152
	}
153
154
	/**
155
	 * @return PdoDatabase
156
	 */
157
	final public function getDatabase()
158
	{
159
		return $this->database;
160
	}
161
162
	/**
163
	 * @param PdoDatabase $database
164
	 */
165
	final public function setDatabase($database)
166
	{
167
		$this->database = $database;
168
	}
169
170
	/**
171
	 * @return IOAuthHelper
172
	 */
173
	public function getOAuthHelper()
174
	{
175
		return $this->oauthHelper;
176
	}
177
178
	/**
179
	 * @param IOAuthHelper $oauthHelper
180
	 */
181
	public function setOAuthHelper($oauthHelper)
182
	{
183
		$this->oauthHelper = $oauthHelper;
184
	}
185
186
	/**
187
	 * @return void
188
	 */
189
	abstract public function execute();
190
191
	/**
192
	 * @return IrcNotificationHelper
193
	 */
194
	public function getNotificationHelper()
195
	{
196
		return $this->notificationHelper;
197
	}
198
199
	/**
200
	 * @param IrcNotificationHelper $notificationHelper
201
	 */
202
	public function setNotificationHelper($notificationHelper)
203
	{
204
		$this->notificationHelper = $notificationHelper;
205
	}
206
207
	/**
208
	 * Gets the site configuration object
209
	 *
210
	 * @return SiteConfiguration
211
	 */
212
	final protected function getSiteConfiguration()
213
	{
214
		return $this->siteConfiguration;
215
	}
216
217
	/**
218
	 * Sets the site configuration object for this page
219
	 *
220
	 * @param SiteConfiguration $configuration
221
	 */
222
	final public function setSiteConfiguration($configuration)
223
	{
224
		$this->siteConfiguration = $configuration;
225
	}
226
}