aboutsummaryrefslogtreecommitdiffstats
path: root/includes/FauxRequest.php
diff options
context:
space:
mode:
authordaniel <dkinzler@wikimedia.org>2022-04-01 17:58:32 +0200
committerdaniel <dkinzler@wikimedia.org>2022-04-07 13:02:28 +0200
commit552ec4181410c66d4c97ac59bb7f685893e233eb (patch)
tree93542b12bdfc1c4104b61b0d00837cc866f2cb46 /includes/FauxRequest.php
parent2a92b07ad38ade7656305337ec120af926f228e0 (diff)
downloadmediawikicore-552ec4181410c66d4c97ac59bb7f685893e233eb.tar.gz
mediawikicore-552ec4181410c66d4c97ac59bb7f685893e233eb.zip
Use name constants to access config settings.
Use name constants instead of string literals in calls to Config::get and ServiceOptions::get, when referring to core configuration variables. This protects against typos and makes the decumentation and schema declaration of the config settings discoverable. This is the first batch, only touching files directly under /includes/ Change-Id: I7252e636c7c86d950d9257b33491af492c6dd5eb
Diffstat (limited to 'includes/FauxRequest.php')
-rw-r--r--includes/FauxRequest.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/FauxRequest.php b/includes/FauxRequest.php
index cb7de524f9f1..f7b196205612 100644
--- a/includes/FauxRequest.php
+++ b/includes/FauxRequest.php
@@ -23,6 +23,7 @@
* @file
*/
+use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
use MediaWiki\Session\SessionManager;
@@ -117,7 +118,7 @@ class FauxRequest extends WebRequest {
public function getCookie( $key, $prefix = null, $default = null ) {
if ( $prefix === null ) {
- $cookiePrefix = MediaWikiServices::getInstance()->getMainConfig()->get( 'CookiePrefix' );
+ $cookiePrefix = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::CookiePrefix );
$prefix = $cookiePrefix;
}
$name = $prefix . $key;
@@ -141,7 +142,7 @@ class FauxRequest extends WebRequest {
*/
public function setCookies( $cookies, $prefix = null ) {
if ( $prefix === null ) {
- $cookiePrefix = MediaWikiServices::getInstance()->getMainConfig()->get( 'CookiePrefix' );
+ $cookiePrefix = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::CookiePrefix );
$prefix = $cookiePrefix;
}
foreach ( $cookies as $key => $value ) {