Code Duplication    Length = 10-11 lines in 2 locations

includes/session/SessionBackend.php 2 locations

@@ 303-312 (lines=10) @@
300
	public function unpersist() {
301
		if ( $this->persist ) {
302
			// Close the PHP session, if we're the one that's open
303
			if ( $this->usePhpSessionHandling && PHPSessionHandler::isEnabled() &&
304
				session_id() === (string)$this->id
305
			) {
306
				$this->logger->debug(
307
					'SessionBackend "{session}" Closing PHP session for unpersist',
308
					[ 'session' => $this->id ]
309
				);
310
				session_write_close();
311
				session_id( '' );
312
			}
313
314
			$this->persist = false;
315
			$this->forcePersist = true;
@@ 758-768 (lines=11) @@
755
				$this->checkPHPSessionRecursionGuard = false;
756
			} );
757
758
			if ( $this->usePhpSessionHandling && session_id() === '' && PHPSessionHandler::isEnabled() &&
759
				SessionManager::getGlobalSession()->getId() === (string)$this->id
760
			) {
761
				$this->logger->debug(
762
					'SessionBackend "{session}" Taking over PHP session',
763
					[
764
						'session' => $this->id,
765
				] );
766
				session_id( (string)$this->id );
767
				\MediaWiki\quietCall( 'session_start' );
768
			}
769
		}
770
	}
771