Code Duplication    Length = 8-10 lines in 2 locations

includes/session/PHPSessionHandler.php 1 location

@@ 238-247 (lines=10) @@
235
		}
236
237
		$session = $this->manager->getSessionById( $id, true );
238
		if ( !$session ) {
239
			// This can happen under normal circumstances, if the session exists but is
240
			// invalid. Let's emit a log warning instead of a PHP warning.
241
			$this->logger->warning(
242
				__METHOD__ . ': Session "{session}" cannot be loaded, skipping write.',
243
				[
244
					'session' => $id,
245
			] );
246
			return true;
247
		}
248
249
		// First, decode the string PHP handed us
250
		$data = \Wikimedia\PhpSessionSerializer::decode( $dataStr );

includes/session/SessionManager.php 1 location

@@ 893-900 (lines=8) @@
890
			}
891
		} else {
892
			// No metadata, so we can't load the provider if one wasn't given.
893
			if ( $info->getProvider() === null ) {
894
				$this->logger->warning(
895
					'Session "{session}": Null provider and no metadata',
896
					[
897
						'session' => $info,
898
				] );
899
				return false;
900
			}
901
902
			// If no user was provided and no metadata, it must be anon.
903
			if ( !$info->getUserInfo() ) {