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

@@ 527-536 (lines=10) @@
524
	 *
525
	 * @return ScopedCallback|null
526
	 */
527
	final protected function getScopedPHPBehaviorForCommit() {
528
		if ( PHP_SAPI != 'cli' ) { // http://bugs.php.net/bug.php?id=47540
529
			$old = ignore_user_abort( true ); // avoid half-finished operations
530
			return new ScopedCallback( function () use ( $old ) {
531
				ignore_user_abort( $old );
532
			} );
533
		}
534
535
		return null;
536
	}
537
538
	function __destruct() {
539
		$this->destroy();

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

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