Code Duplication    Length = 10-10 lines in 3 locations

includes/libs/filebackend/FileBackend.php 1 location

@@ 930-939 (lines=10) @@
927
	 *
928
	 * @return ScopedCallback|null
929
	 */
930
	final protected function getScopedPHPBehaviorForOps() {
931
		if ( PHP_SAPI != 'cli' ) { // https://bugs.php.net/bug.php?id=47540
932
			$old = ignore_user_abort( true ); // avoid half-finished operations
933
			return new ScopedCallback( function () use ( $old ) {
934
				ignore_user_abort( $old );
935
			} );
936
		}
937
938
		return null;
939
	}
940
941
	/**
942
	 * Check if a file exists at a storage path in the backend.

includes/libs/rdbms/loadbalancer/LoadBalancer.php 1 location

@@ 1531-1540 (lines=10) @@
1528
	 *
1529
	 * @return ScopedCallback|null
1530
	 */
1531
	final protected function getScopedPHPBehaviorForCommit() {
1532
		if ( PHP_SAPI != 'cli' ) { // https://bugs.php.net/bug.php?id=47540
1533
			$old = ignore_user_abort( true ); // avoid half-finished operations
1534
			return new ScopedCallback( function () use ( $old ) {
1535
				ignore_user_abort( $old );
1536
			} );
1537
		}
1538
1539
		return null;
1540
	}
1541
1542
	function __destruct() {
1543
		// Avoid connection leaks for sanity

includes/libs/rdbms/lbfactory/LBFactory.php 1 location

@@ 557-566 (lines=10) @@
554
	 *
555
	 * @return ScopedCallback|null
556
	 */
557
	final protected function getScopedPHPBehaviorForCommit() {
558
		if ( PHP_SAPI != 'cli' ) { // https://bugs.php.net/bug.php?id=47540
559
			$old = ignore_user_abort( true ); // avoid half-finished operations
560
			return new ScopedCallback( function () use ( $old ) {
561
				ignore_user_abort( $old );
562
			} );
563
		}
564
565
		return null;
566
	}
567
568
	function __destruct() {
569
		$this->destroy();