aboutsummaryrefslogtreecommitdiffstats
path: root/includes/session/CookieSessionProvider.php
diff options
context:
space:
mode:
authorEbrahim Byagowi <ebrahim@gnu.org>2024-05-19 20:59:11 +0330
committerEbrahim Byagowi <ebrahim@gnu.org>2024-05-19 23:57:44 +0330
commitb5727d94b52a3da55453535347773e2ecebfc1a6 (patch)
tree0483275f6a6231d73539b3b7c7969f06d2404a2a /includes/session/CookieSessionProvider.php
parent36eef7f7d4102931120bffa254527889b130562a (diff)
downloadmediawikicore-b5727d94b52a3da55453535347773e2ecebfc1a6.tar.gz
mediawikicore-b5727d94b52a3da55453535347773e2ecebfc1a6.zip
Import InvalidArgumentException at top of the source
It was asked in a patch review to apply fully import InvalidArgumentException where possible. I was guessing some of my other already merged patches have but turned out such thing exists other places style so for the sake of consistency I've turned rest of inline import of the specific exception at top of the file. There are instances of source files that aren't in any namespace but have fully qualified import which this patch doesn't touch. Change-Id: I4071fc698b65746d9594cf4d5f45bae82843d436
Diffstat (limited to 'includes/session/CookieSessionProvider.php')
-rw-r--r--includes/session/CookieSessionProvider.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/includes/session/CookieSessionProvider.php b/includes/session/CookieSessionProvider.php
index 0f46be27d1dc..bf60313727ec 100644
--- a/includes/session/CookieSessionProvider.php
+++ b/includes/session/CookieSessionProvider.php
@@ -23,6 +23,7 @@
namespace MediaWiki\Session;
+use InvalidArgumentException;
use MediaWiki\MainConfigNames;
use MediaWiki\Request\WebRequest;
use MediaWiki\User\User;
@@ -65,16 +66,16 @@ class CookieSessionProvider extends SessionProvider {
// @codeCoverageIgnoreEnd
if ( !isset( $params['priority'] ) ) {
- throw new \InvalidArgumentException( __METHOD__ . ': priority must be specified' );
+ throw new InvalidArgumentException( __METHOD__ . ': priority must be specified' );
}
if ( $params['priority'] < SessionInfo::MIN_PRIORITY ||
$params['priority'] > SessionInfo::MAX_PRIORITY
) {
- throw new \InvalidArgumentException( __METHOD__ . ': Invalid priority' );
+ throw new InvalidArgumentException( __METHOD__ . ': Invalid priority' );
}
if ( !is_array( $params['cookieOptions'] ) ) {
- throw new \InvalidArgumentException( __METHOD__ . ': cookieOptions must be an array' );
+ throw new InvalidArgumentException( __METHOD__ . ': cookieOptions must be an array' );
}
$this->priority = $params['priority'];
@@ -121,7 +122,7 @@ class CookieSessionProvider extends SessionProvider {
if ( $userId !== null ) {
try {
$userInfo = UserInfo::newFromId( $userId );
- } catch ( \InvalidArgumentException $ex ) {
+ } catch ( InvalidArgumentException $ex ) {
return null;
}