| Total Complexity | 98 |
| Total Lines | 1010 |
| Duplicated Lines | 0 % |
| Changes | 5 | ||
| Bugs | 1 | Features | 0 |
Complex classes like SiteConfiguration often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use SiteConfiguration, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 18 | class SiteConfiguration |
||
| 19 | { |
||
| 20 | private $baseUrl; |
||
| 21 | private $filePath; |
||
| 22 | private $schemaVersion = 42; |
||
| 23 | private $debuggingTraceEnabled; |
||
| 24 | private $debuggingCssBreakpointsEnabled; |
||
| 25 | private $dataClearIp = '127.0.0.1'; |
||
| 26 | private $dataClearEmail = '[email protected]'; |
||
| 27 | private $dataClearInterval = '15 DAY'; |
||
| 28 | private $forceIdentification = true; |
||
| 29 | private $identificationCacheExpiry = '1 DAY'; |
||
| 30 | private $metaWikimediaWebServiceEndpoint = 'https://meta.wikimedia.org/w/api.php'; |
||
| 31 | private $enforceOAuth = true; |
||
| 32 | private $emailConfirmationEnabled = true; |
||
| 33 | private $emailConfirmationExpiryDays = 7; |
||
| 34 | private $miserModeLimit = 25; |
||
| 35 | private $squidList = array(); |
||
| 36 | private $useStrictTransportSecurity = false; |
||
| 37 | private $userAgent = 'Wikipedia-ACC Tool/0.1 (+https://accounts.wmflabs.org/internal.php/team)'; |
||
| 38 | private $curlDisableVerifyPeer = false; |
||
| 39 | private $useOAuthSignup = true; |
||
| 40 | private $oauthConsumerToken; |
||
| 41 | /** @var array */ |
||
| 42 | private $oauthLegacyConsumerTokens; |
||
| 43 | private $oauthConsumerSecret; |
||
| 44 | private $oauthIdentityGraceTime = '24 hours'; |
||
| 45 | private $oauthMediaWikiCanonicalServer = 'http://en.wikipedia.org'; |
||
| 46 | private $xffTrustedHostsFile = '../TrustedXFF/trusted-hosts.txt'; |
||
| 47 | private $crossOriginResourceSharingHosts = array( |
||
| 48 | "http://en.wikipedia.org", |
||
| 49 | "https://en.wikipedia.org", |
||
| 50 | "http://meta.wikimedia.org", |
||
| 51 | "https://meta.wikimedia.org", |
||
| 52 | ); |
||
| 53 | private $ircNotificationsEnabled = true; |
||
| 54 | private $ircNotificationsInstance = 'Development'; |
||
| 55 | private $errorLog = 'errorlog'; |
||
| 56 | private $titleBlacklistEnabled = false; |
||
| 57 | /** @var null|string $locationProviderApiKey */ |
||
| 58 | private $locationProviderApiKey = null; |
||
| 59 | private $torExitPaths = array(); |
||
| 60 | private $creationBotUsername = ''; |
||
| 61 | private $creationBotPassword = ''; |
||
| 62 | private $curlCookieJar = null; |
||
| 63 | private $yubicoApiId = 0; |
||
| 64 | private $yubicoApiKey = ""; |
||
| 65 | private $totpEncryptionKey = "1234"; |
||
| 66 | private $identificationNoticeboardPage = 'Access to nonpublic personal data policy/Noticeboard'; |
||
| 67 | private $registrationAllowed = true; |
||
| 68 | private $cspReportUri = null; |
||
| 69 | private $resourceCacheEpoch = 1; |
||
| 70 | private $commonEmailDomains = []; |
||
| 71 | private $banMaxIpBlockRange = [4 => 20, 6 => 48]; |
||
| 72 | private $banMaxIpRange = [4 => 16, 6 => 32]; |
||
| 73 | private $jobQueueBatchSize = 10; |
||
| 74 | private $amqpConfiguration = ['host' => 'localhost', 'port' => 5672, 'user' => 'guest', 'password' => 'guest', 'exchange' => '']; |
||
| 75 | private $emailSender = '[email protected]'; |
||
| 76 | |||
| 77 | /** |
||
| 78 | * Gets the base URL of the tool |
||
| 79 | * |
||
| 80 | * If the internal page of the tool is at http://localhost/path/internal.php, this would be set to |
||
| 81 | * http://localhost/path |
||
| 82 | * @return string |
||
| 83 | */ |
||
| 84 | public function getBaseUrl() |
||
| 85 | { |
||
| 86 | return $this->baseUrl; |
||
| 87 | } |
||
| 88 | |||
| 89 | /** |
||
| 90 | * @param string $baseUrl |
||
| 91 | * |
||
| 92 | * @return SiteConfiguration |
||
| 93 | */ |
||
| 94 | public function setBaseUrl($baseUrl) |
||
| 95 | { |
||
| 96 | $this->baseUrl = $baseUrl; |
||
| 97 | |||
| 98 | return $this; |
||
| 99 | } |
||
| 100 | |||
| 101 | /** |
||
| 102 | * Path on disk to the directory containing the tool's code |
||
| 103 | * @return string |
||
| 104 | */ |
||
| 105 | public function getFilePath() |
||
| 106 | { |
||
| 107 | return $this->filePath; |
||
| 108 | } |
||
| 109 | |||
| 110 | /** |
||
| 111 | * @param string $filePath |
||
| 112 | * |
||
| 113 | * @return SiteConfiguration |
||
| 114 | */ |
||
| 115 | public function setFilePath($filePath) |
||
| 116 | { |
||
| 117 | $this->filePath = $filePath; |
||
| 118 | |||
| 119 | return $this; |
||
| 120 | } |
||
| 121 | |||
| 122 | /** |
||
| 123 | * @return int |
||
| 124 | */ |
||
| 125 | public function getSchemaVersion() |
||
| 126 | { |
||
| 127 | return $this->schemaVersion; |
||
| 128 | } |
||
| 129 | |||
| 130 | /** |
||
| 131 | * @param int $schemaVersion |
||
| 132 | * |
||
| 133 | * @return SiteConfiguration |
||
| 134 | */ |
||
| 135 | public function setSchemaVersion($schemaVersion) |
||
| 136 | { |
||
| 137 | $this->schemaVersion = $schemaVersion; |
||
| 138 | |||
| 139 | return $this; |
||
| 140 | } |
||
| 141 | |||
| 142 | /** |
||
| 143 | * @return mixed |
||
| 144 | */ |
||
| 145 | public function getDebuggingTraceEnabled() |
||
| 146 | { |
||
| 147 | return $this->debuggingTraceEnabled; |
||
| 148 | } |
||
| 149 | |||
| 150 | /** |
||
| 151 | * @param mixed $debuggingTraceEnabled |
||
| 152 | * |
||
| 153 | * @return SiteConfiguration |
||
| 154 | */ |
||
| 155 | public function setDebuggingTraceEnabled($debuggingTraceEnabled) |
||
| 156 | { |
||
| 157 | $this->debuggingTraceEnabled = $debuggingTraceEnabled; |
||
| 158 | |||
| 159 | return $this; |
||
| 160 | } |
||
| 161 | |||
| 162 | public function getDebuggingCssBreakpointsEnabled() : bool |
||
| 163 | { |
||
| 164 | return $this->debuggingCssBreakpointsEnabled; |
||
| 165 | } |
||
| 166 | |||
| 167 | public function setDebuggingCssBreakpointsEnabled(bool $debuggingCssBreakpointsEnabled) : SiteConfiguration |
||
| 168 | { |
||
| 169 | $this->debuggingCssBreakpointsEnabled = $debuggingCssBreakpointsEnabled; |
||
| 170 | |||
| 171 | return $this; |
||
| 172 | } |
||
| 173 | |||
| 174 | /** |
||
| 175 | * @return string |
||
| 176 | */ |
||
| 177 | public function getDataClearIp() |
||
| 178 | { |
||
| 179 | return $this->dataClearIp; |
||
| 180 | } |
||
| 181 | |||
| 182 | /** |
||
| 183 | * @param string $dataClearIp |
||
| 184 | * |
||
| 185 | * @return SiteConfiguration |
||
| 186 | */ |
||
| 187 | public function setDataClearIp($dataClearIp) |
||
| 188 | { |
||
| 189 | $this->dataClearIp = $dataClearIp; |
||
| 190 | |||
| 191 | return $this; |
||
| 192 | } |
||
| 193 | |||
| 194 | /** |
||
| 195 | * @return string |
||
| 196 | */ |
||
| 197 | public function getDataClearEmail() |
||
| 198 | { |
||
| 199 | return $this->dataClearEmail; |
||
| 200 | } |
||
| 201 | |||
| 202 | /** |
||
| 203 | * @param string $dataClearEmail |
||
| 204 | * |
||
| 205 | * @return SiteConfiguration |
||
| 206 | */ |
||
| 207 | public function setDataClearEmail($dataClearEmail) |
||
| 208 | { |
||
| 209 | $this->dataClearEmail = $dataClearEmail; |
||
| 210 | |||
| 211 | return $this; |
||
| 212 | } |
||
| 213 | |||
| 214 | /** |
||
| 215 | * @return boolean |
||
| 216 | */ |
||
| 217 | public function getForceIdentification() |
||
| 218 | { |
||
| 219 | return $this->forceIdentification; |
||
| 220 | } |
||
| 221 | |||
| 222 | /** |
||
| 223 | * @param boolean $forceIdentification |
||
| 224 | * |
||
| 225 | * @return SiteConfiguration |
||
| 226 | */ |
||
| 227 | public function setForceIdentification($forceIdentification) |
||
| 228 | { |
||
| 229 | $this->forceIdentification = $forceIdentification; |
||
| 230 | |||
| 231 | return $this; |
||
| 232 | } |
||
| 233 | |||
| 234 | /** |
||
| 235 | * @return string |
||
| 236 | */ |
||
| 237 | public function getIdentificationCacheExpiry() |
||
| 238 | { |
||
| 239 | return $this->identificationCacheExpiry; |
||
| 240 | } |
||
| 241 | |||
| 242 | /** |
||
| 243 | * @param string $identificationCacheExpiry |
||
| 244 | * |
||
| 245 | * @return SiteConfiguration |
||
| 246 | */ |
||
| 247 | public function setIdentificationCacheExpiry($identificationCacheExpiry) |
||
| 248 | { |
||
| 249 | $this->identificationCacheExpiry = $identificationCacheExpiry; |
||
| 250 | |||
| 251 | return $this; |
||
| 252 | } |
||
| 253 | |||
| 254 | /** |
||
| 255 | * @return string |
||
| 256 | */ |
||
| 257 | public function getMetaWikimediaWebServiceEndpoint() |
||
| 260 | } |
||
| 261 | |||
| 262 | /** |
||
| 263 | * @param string $metaWikimediaWebServiceEndpoint |
||
| 264 | * |
||
| 265 | * @return SiteConfiguration |
||
| 266 | */ |
||
| 267 | public function setMetaWikimediaWebServiceEndpoint($metaWikimediaWebServiceEndpoint) |
||
| 268 | { |
||
| 269 | $this->metaWikimediaWebServiceEndpoint = $metaWikimediaWebServiceEndpoint; |
||
| 270 | |||
| 271 | return $this; |
||
| 272 | } |
||
| 273 | |||
| 274 | /** |
||
| 275 | * @return boolean |
||
| 276 | */ |
||
| 277 | public function getEnforceOAuth() |
||
| 278 | { |
||
| 279 | return $this->enforceOAuth; |
||
| 280 | } |
||
| 281 | |||
| 282 | /** |
||
| 283 | * @param boolean $enforceOAuth |
||
| 284 | * |
||
| 285 | * @return SiteConfiguration |
||
| 286 | */ |
||
| 287 | public function setEnforceOAuth($enforceOAuth) |
||
| 288 | { |
||
| 289 | $this->enforceOAuth = $enforceOAuth; |
||
| 290 | |||
| 291 | return $this; |
||
| 292 | } |
||
| 293 | |||
| 294 | /** |
||
| 295 | * @return boolean |
||
| 296 | */ |
||
| 297 | public function getEmailConfirmationEnabled() |
||
| 298 | { |
||
| 299 | return $this->emailConfirmationEnabled; |
||
| 300 | } |
||
| 301 | |||
| 302 | /** |
||
| 303 | * @param boolean $emailConfirmationEnabled |
||
| 304 | * |
||
| 305 | * @return $this |
||
| 306 | */ |
||
| 307 | public function setEmailConfirmationEnabled($emailConfirmationEnabled) |
||
| 308 | { |
||
| 309 | $this->emailConfirmationEnabled = $emailConfirmationEnabled; |
||
| 310 | |||
| 311 | return $this; |
||
| 312 | } |
||
| 313 | |||
| 314 | /** |
||
| 315 | * @return int |
||
| 316 | */ |
||
| 317 | public function getMiserModeLimit() |
||
| 320 | } |
||
| 321 | |||
| 322 | /** |
||
| 323 | * @param int $miserModeLimit |
||
| 324 | * |
||
| 325 | * @return SiteConfiguration |
||
| 326 | */ |
||
| 327 | public function setMiserModeLimit($miserModeLimit) |
||
| 328 | { |
||
| 329 | $this->miserModeLimit = $miserModeLimit; |
||
| 330 | |||
| 331 | return $this; |
||
| 332 | } |
||
| 333 | |||
| 334 | /** |
||
| 335 | * @return array |
||
| 336 | */ |
||
| 337 | public function getSquidList() |
||
| 338 | { |
||
| 339 | return $this->squidList; |
||
| 340 | } |
||
| 341 | |||
| 342 | /** |
||
| 343 | * @param array $squidList |
||
| 344 | * |
||
| 345 | * @return SiteConfiguration |
||
| 346 | */ |
||
| 347 | public function setSquidList($squidList) |
||
| 348 | { |
||
| 349 | $this->squidList = $squidList; |
||
| 350 | |||
| 351 | return $this; |
||
| 352 | } |
||
| 353 | |||
| 354 | /** |
||
| 355 | * @return boolean |
||
| 356 | */ |
||
| 357 | public function getUseStrictTransportSecurity() |
||
| 358 | { |
||
| 359 | return $this->useStrictTransportSecurity; |
||
| 360 | } |
||
| 361 | |||
| 362 | /** |
||
| 363 | * @param boolean $useStrictTransportSecurity |
||
| 364 | * |
||
| 365 | * @return SiteConfiguration |
||
| 366 | */ |
||
| 367 | public function setUseStrictTransportSecurity($useStrictTransportSecurity) |
||
| 368 | { |
||
| 369 | $this->useStrictTransportSecurity = $useStrictTransportSecurity; |
||
| 370 | |||
| 371 | return $this; |
||
| 372 | } |
||
| 373 | |||
| 374 | /** |
||
| 375 | * @return string |
||
| 376 | */ |
||
| 377 | public function getUserAgent() |
||
| 378 | { |
||
| 379 | return $this->userAgent; |
||
| 380 | } |
||
| 381 | |||
| 382 | /** |
||
| 383 | * @param string $userAgent |
||
| 384 | * |
||
| 385 | * @return SiteConfiguration |
||
| 386 | */ |
||
| 387 | public function setUserAgent($userAgent) |
||
| 388 | { |
||
| 389 | $this->userAgent = $userAgent; |
||
| 390 | |||
| 391 | return $this; |
||
| 392 | } |
||
| 393 | |||
| 394 | /** |
||
| 395 | * @return boolean |
||
| 396 | */ |
||
| 397 | public function getCurlDisableVerifyPeer() |
||
| 398 | { |
||
| 399 | return $this->curlDisableVerifyPeer; |
||
| 400 | } |
||
| 401 | |||
| 402 | /** |
||
| 403 | * @param boolean $curlDisableVerifyPeer |
||
| 404 | * |
||
| 405 | * @return SiteConfiguration |
||
| 406 | */ |
||
| 407 | public function setCurlDisableVerifyPeer($curlDisableVerifyPeer) |
||
| 408 | { |
||
| 409 | $this->curlDisableVerifyPeer = $curlDisableVerifyPeer; |
||
| 410 | |||
| 411 | return $this; |
||
| 412 | } |
||
| 413 | |||
| 414 | /** |
||
| 415 | * @return boolean |
||
| 416 | */ |
||
| 417 | public function getUseOAuthSignup() |
||
| 418 | { |
||
| 419 | return $this->useOAuthSignup; |
||
| 420 | } |
||
| 421 | |||
| 422 | /** |
||
| 423 | * @param boolean $useOAuthSignup |
||
| 424 | * |
||
| 425 | * @return SiteConfiguration |
||
| 426 | */ |
||
| 427 | public function setUseOAuthSignup($useOAuthSignup) |
||
| 428 | { |
||
| 429 | $this->useOAuthSignup = $useOAuthSignup; |
||
| 430 | |||
| 431 | return $this; |
||
| 432 | } |
||
| 433 | |||
| 434 | /** |
||
| 435 | * @return mixed |
||
| 436 | */ |
||
| 437 | public function getOAuthConsumerToken() |
||
| 438 | { |
||
| 439 | return $this->oauthConsumerToken; |
||
| 440 | } |
||
| 441 | |||
| 442 | /** |
||
| 443 | * @param mixed $oauthConsumerToken |
||
| 444 | * |
||
| 445 | * @return SiteConfiguration |
||
| 446 | */ |
||
| 447 | public function setOAuthConsumerToken($oauthConsumerToken) |
||
| 448 | { |
||
| 449 | $this->oauthConsumerToken = $oauthConsumerToken; |
||
| 450 | |||
| 451 | return $this; |
||
| 452 | } |
||
| 453 | |||
| 454 | /** |
||
| 455 | * @return mixed |
||
| 456 | */ |
||
| 457 | public function getOAuthConsumerSecret() |
||
| 458 | { |
||
| 459 | return $this->oauthConsumerSecret; |
||
| 460 | } |
||
| 461 | |||
| 462 | /** |
||
| 463 | * @param mixed $oauthConsumerSecret |
||
| 464 | * |
||
| 465 | * @return SiteConfiguration |
||
| 466 | */ |
||
| 467 | public function setOAuthConsumerSecret($oauthConsumerSecret) |
||
| 468 | { |
||
| 469 | $this->oauthConsumerSecret = $oauthConsumerSecret; |
||
| 470 | |||
| 471 | return $this; |
||
| 472 | } |
||
| 473 | |||
| 474 | /** |
||
| 475 | * @return string |
||
| 476 | */ |
||
| 477 | public function getDataClearInterval() |
||
| 478 | { |
||
| 479 | return $this->dataClearInterval; |
||
| 480 | } |
||
| 481 | |||
| 482 | /** |
||
| 483 | * @param string $dataClearInterval |
||
| 484 | * |
||
| 485 | * @return SiteConfiguration |
||
| 486 | */ |
||
| 487 | public function setDataClearInterval($dataClearInterval) |
||
| 488 | { |
||
| 489 | $this->dataClearInterval = $dataClearInterval; |
||
| 490 | |||
| 491 | return $this; |
||
| 492 | } |
||
| 493 | |||
| 494 | /** |
||
| 495 | * @return string |
||
| 496 | */ |
||
| 497 | public function getXffTrustedHostsFile() |
||
| 498 | { |
||
| 499 | return $this->xffTrustedHostsFile; |
||
| 500 | } |
||
| 501 | |||
| 502 | /** |
||
| 503 | * @param string $xffTrustedHostsFile |
||
| 504 | * |
||
| 505 | * @return SiteConfiguration |
||
| 506 | */ |
||
| 507 | public function setXffTrustedHostsFile($xffTrustedHostsFile) |
||
| 508 | { |
||
| 509 | $this->xffTrustedHostsFile = $xffTrustedHostsFile; |
||
| 510 | |||
| 511 | return $this; |
||
| 512 | } |
||
| 513 | |||
| 514 | /** |
||
| 515 | * @return array |
||
| 516 | */ |
||
| 517 | public function getCrossOriginResourceSharingHosts() |
||
| 518 | { |
||
| 519 | return $this->crossOriginResourceSharingHosts; |
||
| 520 | } |
||
| 521 | |||
| 522 | /** |
||
| 523 | * @param array $crossOriginResourceSharingHosts |
||
| 524 | * |
||
| 525 | * @return SiteConfiguration |
||
| 526 | */ |
||
| 527 | public function setCrossOriginResourceSharingHosts($crossOriginResourceSharingHosts) |
||
| 528 | { |
||
| 529 | $this->crossOriginResourceSharingHosts = $crossOriginResourceSharingHosts; |
||
| 530 | |||
| 531 | return $this; |
||
| 532 | } |
||
| 533 | |||
| 534 | /** |
||
| 535 | * @return boolean |
||
| 536 | */ |
||
| 537 | public function getIrcNotificationsEnabled() |
||
| 538 | { |
||
| 539 | return $this->ircNotificationsEnabled; |
||
| 540 | } |
||
| 541 | |||
| 542 | /** |
||
| 543 | * @param boolean $ircNotificationsEnabled |
||
| 544 | * |
||
| 545 | * @return SiteConfiguration |
||
| 546 | */ |
||
| 547 | public function setIrcNotificationsEnabled($ircNotificationsEnabled) |
||
| 548 | { |
||
| 549 | $this->ircNotificationsEnabled = $ircNotificationsEnabled; |
||
| 550 | |||
| 551 | return $this; |
||
| 552 | } |
||
| 553 | |||
| 554 | /** |
||
| 555 | * @param string $errorLog |
||
| 556 | * |
||
| 557 | * @return SiteConfiguration |
||
| 558 | */ |
||
| 559 | public function setErrorLog($errorLog) |
||
| 560 | { |
||
| 561 | $this->errorLog = $errorLog; |
||
| 562 | |||
| 563 | return $this; |
||
| 564 | } |
||
| 565 | |||
| 566 | /** |
||
| 567 | * @return string |
||
| 568 | */ |
||
| 569 | public function getErrorLog() |
||
| 570 | { |
||
| 571 | return $this->errorLog; |
||
| 572 | } |
||
| 573 | |||
| 574 | /** |
||
| 575 | * @param int $emailConfirmationExpiryDays |
||
| 576 | * |
||
| 577 | * @return SiteConfiguration |
||
| 578 | */ |
||
| 579 | public function setEmailConfirmationExpiryDays($emailConfirmationExpiryDays) |
||
| 580 | { |
||
| 581 | $this->emailConfirmationExpiryDays = $emailConfirmationExpiryDays; |
||
| 582 | |||
| 583 | return $this; |
||
| 584 | } |
||
| 585 | |||
| 586 | /** |
||
| 587 | * @return int |
||
| 588 | */ |
||
| 589 | public function getEmailConfirmationExpiryDays() |
||
| 590 | { |
||
| 591 | return $this->emailConfirmationExpiryDays; |
||
| 592 | } |
||
| 593 | |||
| 594 | /** |
||
| 595 | * @param string $ircNotificationsInstance |
||
| 596 | * |
||
| 597 | * @return SiteConfiguration |
||
| 598 | */ |
||
| 599 | public function setIrcNotificationsInstance($ircNotificationsInstance) |
||
| 600 | { |
||
| 601 | $this->ircNotificationsInstance = $ircNotificationsInstance; |
||
| 602 | |||
| 603 | return $this; |
||
| 604 | } |
||
| 605 | |||
| 606 | /** |
||
| 607 | * @return string |
||
| 608 | */ |
||
| 609 | public function getIrcNotificationsInstance() |
||
| 610 | { |
||
| 611 | return $this->ircNotificationsInstance; |
||
| 612 | } |
||
| 613 | |||
| 614 | /** |
||
| 615 | * @param boolean $titleBlacklistEnabled |
||
| 616 | * |
||
| 617 | * @return SiteConfiguration |
||
| 618 | */ |
||
| 619 | public function setTitleBlacklistEnabled($titleBlacklistEnabled) |
||
| 620 | { |
||
| 621 | $this->titleBlacklistEnabled = $titleBlacklistEnabled; |
||
| 622 | |||
| 623 | return $this; |
||
| 624 | } |
||
| 625 | |||
| 626 | /** |
||
| 627 | * @return boolean |
||
| 628 | */ |
||
| 629 | public function getTitleBlacklistEnabled() |
||
| 630 | { |
||
| 631 | return $this->titleBlacklistEnabled; |
||
| 632 | } |
||
| 633 | |||
| 634 | /** |
||
| 635 | * @param string|null $locationProviderApiKey |
||
| 636 | * |
||
| 637 | * @return SiteConfiguration |
||
| 638 | */ |
||
| 639 | public function setLocationProviderApiKey($locationProviderApiKey) |
||
| 640 | { |
||
| 641 | $this->locationProviderApiKey = $locationProviderApiKey; |
||
| 642 | |||
| 643 | return $this; |
||
| 644 | } |
||
| 645 | |||
| 646 | /** |
||
| 647 | * @return null|string |
||
| 648 | */ |
||
| 649 | public function getLocationProviderApiKey() |
||
| 650 | { |
||
| 651 | return $this->locationProviderApiKey; |
||
| 652 | } |
||
| 653 | |||
| 654 | /** |
||
| 655 | * @param array $torExitPaths |
||
| 656 | * |
||
| 657 | * @return SiteConfiguration |
||
| 658 | */ |
||
| 659 | public function setTorExitPaths($torExitPaths) |
||
| 660 | { |
||
| 661 | $this->torExitPaths = $torExitPaths; |
||
| 662 | |||
| 663 | return $this; |
||
| 664 | } |
||
| 665 | |||
| 666 | /** |
||
| 667 | * @return array |
||
| 668 | */ |
||
| 669 | public function getTorExitPaths() |
||
| 670 | { |
||
| 671 | return $this->torExitPaths; |
||
| 672 | } |
||
| 673 | |||
| 674 | /** |
||
| 675 | * @param string $oauthIdentityGraceTime |
||
| 676 | * |
||
| 677 | * @return SiteConfiguration |
||
| 678 | */ |
||
| 679 | public function setOauthIdentityGraceTime($oauthIdentityGraceTime) |
||
| 680 | { |
||
| 681 | $this->oauthIdentityGraceTime = $oauthIdentityGraceTime; |
||
| 682 | |||
| 683 | return $this; |
||
| 684 | } |
||
| 685 | |||
| 686 | /** |
||
| 687 | * @return string |
||
| 688 | */ |
||
| 689 | public function getOauthIdentityGraceTime() |
||
| 690 | { |
||
| 691 | return $this->oauthIdentityGraceTime; |
||
| 692 | } |
||
| 693 | |||
| 694 | /** |
||
| 695 | * @param string $oauthMediaWikiCanonicalServer |
||
| 696 | * |
||
| 697 | * @return SiteConfiguration |
||
| 698 | */ |
||
| 699 | public function setOauthMediaWikiCanonicalServer($oauthMediaWikiCanonicalServer) |
||
| 700 | { |
||
| 701 | $this->oauthMediaWikiCanonicalServer = $oauthMediaWikiCanonicalServer; |
||
| 702 | |||
| 703 | return $this; |
||
| 704 | } |
||
| 705 | |||
| 706 | /** |
||
| 707 | * @return string |
||
| 708 | */ |
||
| 709 | public function getOauthMediaWikiCanonicalServer() |
||
| 710 | { |
||
| 711 | return $this->oauthMediaWikiCanonicalServer; |
||
| 712 | } |
||
| 713 | |||
| 714 | /** |
||
| 715 | * @param string $creationBotUsername |
||
| 716 | * |
||
| 717 | * @return SiteConfiguration |
||
| 718 | */ |
||
| 719 | public function setCreationBotUsername($creationBotUsername) |
||
| 720 | { |
||
| 721 | $this->creationBotUsername = $creationBotUsername; |
||
| 722 | |||
| 723 | return $this; |
||
| 724 | } |
||
| 725 | |||
| 726 | /** |
||
| 727 | * @return string |
||
| 728 | */ |
||
| 729 | public function getCreationBotUsername() |
||
| 730 | { |
||
| 731 | return $this->creationBotUsername; |
||
| 732 | } |
||
| 733 | |||
| 734 | /** |
||
| 735 | * @param string $creationBotPassword |
||
| 736 | * |
||
| 737 | * @return SiteConfiguration |
||
| 738 | */ |
||
| 739 | public function setCreationBotPassword($creationBotPassword) |
||
| 740 | { |
||
| 741 | $this->creationBotPassword = $creationBotPassword; |
||
| 742 | |||
| 743 | return $this; |
||
| 744 | } |
||
| 745 | |||
| 746 | /** |
||
| 747 | * @return string |
||
| 748 | */ |
||
| 749 | public function getCreationBotPassword() |
||
| 750 | { |
||
| 751 | return $this->creationBotPassword; |
||
| 752 | } |
||
| 753 | |||
| 754 | /** |
||
| 755 | * @param string|null $curlCookieJar |
||
| 756 | * |
||
| 757 | * @return SiteConfiguration |
||
| 758 | */ |
||
| 759 | public function setCurlCookieJar($curlCookieJar) |
||
| 760 | { |
||
| 761 | $this->curlCookieJar = $curlCookieJar; |
||
| 762 | |||
| 763 | return $this; |
||
| 764 | } |
||
| 765 | |||
| 766 | /** |
||
| 767 | * @return string|null |
||
| 768 | */ |
||
| 769 | public function getCurlCookieJar() |
||
| 770 | { |
||
| 771 | return $this->curlCookieJar; |
||
| 772 | } |
||
| 773 | |||
| 774 | public function getYubicoApiId() |
||
| 775 | { |
||
| 776 | return $this->yubicoApiId; |
||
| 777 | } |
||
| 778 | |||
| 779 | public function setYubicoApiId($id) |
||
| 780 | { |
||
| 781 | $this->yubicoApiId = $id; |
||
| 782 | |||
| 783 | return $this; |
||
| 784 | } |
||
| 785 | |||
| 786 | public function getYubicoApiKey() |
||
| 787 | { |
||
| 788 | return $this->yubicoApiKey; |
||
| 789 | } |
||
| 790 | |||
| 791 | public function setYubicoApiKey($key) |
||
| 792 | { |
||
| 793 | $this->yubicoApiKey = $key; |
||
| 794 | |||
| 795 | return $this; |
||
| 796 | } |
||
| 797 | |||
| 798 | /** |
||
| 799 | * @return string |
||
| 800 | */ |
||
| 801 | public function getTotpEncryptionKey() |
||
| 802 | { |
||
| 803 | return $this->totpEncryptionKey; |
||
| 804 | } |
||
| 805 | |||
| 806 | /** |
||
| 807 | * @param string $totpEncryptionKey |
||
| 808 | * |
||
| 809 | * @return SiteConfiguration |
||
| 810 | */ |
||
| 811 | public function setTotpEncryptionKey($totpEncryptionKey) |
||
| 812 | { |
||
| 813 | $this->totpEncryptionKey = $totpEncryptionKey; |
||
| 814 | |||
| 815 | return $this; |
||
| 816 | } |
||
| 817 | |||
| 818 | /** |
||
| 819 | * @return string |
||
| 820 | */ |
||
| 821 | public function getIdentificationNoticeboardPage() |
||
| 822 | { |
||
| 823 | return $this->identificationNoticeboardPage; |
||
| 824 | } |
||
| 825 | |||
| 826 | /** |
||
| 827 | * @param string $identificationNoticeboardPage |
||
| 828 | * |
||
| 829 | * @return SiteConfiguration |
||
| 830 | */ |
||
| 831 | public function setIdentificationNoticeboardPage($identificationNoticeboardPage) |
||
| 832 | { |
||
| 833 | $this->identificationNoticeboardPage = $identificationNoticeboardPage; |
||
| 834 | |||
| 835 | return $this; |
||
| 836 | } |
||
| 837 | |||
| 838 | public function isRegistrationAllowed(): bool |
||
| 839 | { |
||
| 840 | return $this->registrationAllowed; |
||
| 841 | } |
||
| 842 | |||
| 843 | public function setRegistrationAllowed(bool $registrationAllowed): SiteConfiguration |
||
| 844 | { |
||
| 845 | $this->registrationAllowed = $registrationAllowed; |
||
| 846 | |||
| 847 | return $this; |
||
| 848 | } |
||
| 849 | |||
| 850 | /** |
||
| 851 | * @return string|null |
||
| 852 | */ |
||
| 853 | public function getCspReportUri() |
||
| 854 | { |
||
| 855 | return $this->cspReportUri; |
||
| 856 | } |
||
| 857 | |||
| 858 | /** |
||
| 859 | * @param string|null $cspReportUri |
||
| 860 | * |
||
| 861 | * @return SiteConfiguration |
||
| 862 | */ |
||
| 863 | public function setCspReportUri($cspReportUri) |
||
| 864 | { |
||
| 865 | $this->cspReportUri = $cspReportUri; |
||
| 866 | |||
| 867 | return $this; |
||
| 868 | } |
||
| 869 | |||
| 870 | /** |
||
| 871 | * @return int |
||
| 872 | */ |
||
| 873 | public function getResourceCacheEpoch(): int |
||
| 874 | { |
||
| 875 | return $this->resourceCacheEpoch; |
||
| 876 | } |
||
| 877 | |||
| 878 | /** |
||
| 879 | * @param int $resourceCacheEpoch |
||
| 880 | * |
||
| 881 | * @return SiteConfiguration |
||
| 882 | */ |
||
| 883 | public function setResourceCacheEpoch(int $resourceCacheEpoch): SiteConfiguration |
||
| 884 | { |
||
| 885 | $this->resourceCacheEpoch = $resourceCacheEpoch; |
||
| 886 | |||
| 887 | return $this; |
||
| 888 | } |
||
| 889 | |||
| 890 | /** |
||
| 891 | * @return array |
||
| 892 | */ |
||
| 893 | public function getCommonEmailDomains(): array |
||
| 894 | { |
||
| 895 | return $this->commonEmailDomains; |
||
| 896 | } |
||
| 897 | |||
| 898 | /** |
||
| 899 | * @param array $commonEmailDomains |
||
| 900 | * |
||
| 901 | * @return SiteConfiguration |
||
| 902 | */ |
||
| 903 | public function setCommonEmailDomains(array $commonEmailDomains): SiteConfiguration |
||
| 904 | { |
||
| 905 | $this->commonEmailDomains = $commonEmailDomains; |
||
| 906 | |||
| 907 | return $this; |
||
| 908 | } |
||
| 909 | |||
| 910 | /** |
||
| 911 | * @param int[] $banMaxIpBlockRange |
||
| 912 | * |
||
| 913 | * @return SiteConfiguration |
||
| 914 | */ |
||
| 915 | public function setBanMaxIpBlockRange(array $banMaxIpBlockRange): SiteConfiguration |
||
| 916 | { |
||
| 917 | $this->banMaxIpBlockRange = $banMaxIpBlockRange; |
||
| 918 | |||
| 919 | return $this; |
||
| 920 | } |
||
| 921 | |||
| 922 | /** |
||
| 923 | * @return int[] |
||
| 924 | */ |
||
| 925 | public function getBanMaxIpBlockRange(): array |
||
| 926 | { |
||
| 927 | return $this->banMaxIpBlockRange; |
||
| 928 | } |
||
| 929 | |||
| 930 | /** |
||
| 931 | * @param int[] $banMaxIpRange |
||
| 932 | * |
||
| 933 | * @return SiteConfiguration |
||
| 934 | */ |
||
| 935 | public function setBanMaxIpRange(array $banMaxIpRange): SiteConfiguration |
||
| 936 | { |
||
| 937 | $this->banMaxIpRange = $banMaxIpRange; |
||
| 938 | |||
| 939 | return $this; |
||
| 940 | } |
||
| 941 | |||
| 942 | /** |
||
| 943 | * @return int[] |
||
| 944 | */ |
||
| 945 | public function getBanMaxIpRange(): array |
||
| 946 | { |
||
| 947 | return $this->banMaxIpRange; |
||
| 948 | } |
||
| 949 | |||
| 950 | /** |
||
| 951 | * @param array $oauthLegacyConsumerTokens |
||
| 952 | * |
||
| 953 | * @return SiteConfiguration |
||
| 954 | */ |
||
| 955 | public function setOauthLegacyConsumerTokens(array $oauthLegacyConsumerTokens): SiteConfiguration |
||
| 956 | { |
||
| 957 | $this->oauthLegacyConsumerTokens = $oauthLegacyConsumerTokens; |
||
| 958 | |||
| 959 | return $this; |
||
| 960 | } |
||
| 961 | |||
| 962 | /** |
||
| 963 | * @return array |
||
| 964 | */ |
||
| 965 | public function getOauthLegacyConsumerTokens(): array |
||
| 968 | } |
||
| 969 | |||
| 970 | /** |
||
| 971 | * @return int |
||
| 972 | */ |
||
| 973 | public function getJobQueueBatchSize(): int |
||
| 974 | { |
||
| 975 | return $this->jobQueueBatchSize; |
||
| 976 | } |
||
| 977 | |||
| 978 | /** |
||
| 979 | * @param int $jobQueueBatchSize |
||
| 980 | * |
||
| 981 | * @return SiteConfiguration |
||
| 982 | */ |
||
| 983 | public function setJobQueueBatchSize(int $jobQueueBatchSize): SiteConfiguration |
||
| 984 | { |
||
| 985 | $this->jobQueueBatchSize = $jobQueueBatchSize; |
||
| 986 | |||
| 987 | return $this; |
||
| 988 | } |
||
| 989 | |||
| 990 | /** |
||
| 991 | * @return array |
||
| 992 | */ |
||
| 993 | public function getAmqpConfiguration(): array |
||
| 994 | { |
||
| 995 | return $this->amqpConfiguration; |
||
| 996 | } |
||
| 997 | |||
| 998 | /** |
||
| 999 | * @param array $amqpConfiguration |
||
| 1000 | * |
||
| 1001 | * @return SiteConfiguration |
||
| 1002 | */ |
||
| 1003 | public function setAmqpConfiguration(array $amqpConfiguration): SiteConfiguration |
||
| 1004 | { |
||
| 1005 | $this->amqpConfiguration = $amqpConfiguration; |
||
| 1006 | |||
| 1007 | return $this; |
||
| 1008 | } |
||
| 1009 | |||
| 1010 | /** |
||
| 1011 | * @return string |
||
| 1012 | */ |
||
| 1013 | public function getEmailSender(): string |
||
| 1016 | } |
||
| 1017 | |||
| 1018 | /** |
||
| 1019 | * @param string $emailSender |
||
| 1020 | * |
||
| 1021 | * @return SiteConfiguration |
||
| 1022 | */ |
||
| 1023 | public function setEmailSender(string $emailSender): SiteConfiguration |
||
| 1024 | { |
||
| 1025 | $this->emailSender = $emailSender; |
||
| 1026 | |||
| 1027 | return $this; |
||
| 1028 | } |
||
| 1029 | } |
||
| 1030 |