Failed Conditions
Branch newinternal (3df7fe)
by Simon
04:13
created

TaskBase::getTorExitProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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