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

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