user = $user; $this->userOptionsLookup = $userOptionsLookup; $this->title = $title; } /** * @inheritDoc */ public function getName(): string { return Constants::REQUIREMENT_LIMITED_WIDTH; } /** * Indicates if this skin should be shown with max-width. * @internal * * @return bool */ public function hasUserLimitedWidthEnabled() { $user = $this->user; $userOptionsLookup = $this->userOptionsLookup; $isLimitedWidth = $userOptionsLookup->getOption( $user, Constants::PREF_KEY_LIMITED_WIDTH ); $isLimitedWidth = $isLimitedWidth === null ? true : $userOptionsLookup->getBoolOption( $user, Constants::PREF_KEY_LIMITED_WIDTH ); return $this->title && $isLimitedWidth; } /** * Check query parameter to override config or not. * Then check for AB test value. * Fallback to config value. * * @inheritDoc */ public function isMet(): bool { return $this->hasUserLimitedWidthEnabled(); } }