Code Duplication    Length = 10-10 lines in 3 locations

includes/libs/filebackend/FileBackend.php 1 location

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

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' ) { // http://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();

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

@@ 1523-1532 (lines=10) @@
1520
	 *
1521
	 * @return ScopedCallback|null
1522
	 */
1523
	final protected function getScopedPHPBehaviorForCommit() {
1524
		if ( PHP_SAPI != 'cli' ) { // http://bugs.php.net/bug.php?id=47540
1525
			$old = ignore_user_abort( true ); // avoid half-finished operations
1526
			return new ScopedCallback( function () use ( $old ) {
1527
				ignore_user_abort( $old );
1528
			} );
1529
		}
1530
1531
		return null;
1532
	}
1533
1534
	function __destruct() {
1535
		// Avoid connection leaks for sanity