Code Duplication    Length = 18-18 lines in 2 locations

includes/libs/filebackend/FileBackend.php 2 locations

@@ 424-441 (lines=18) @@
421
	 * @param array $opts Batch operation options
422
	 * @return StatusValue
423
	 */
424
	final public function doOperations( array $ops, array $opts = [] ) {
425
		if ( empty( $opts['bypassReadOnly'] ) && $this->isReadOnly() ) {
426
			return $this->newStatus( 'backend-fail-readonly', $this->name, $this->readOnly );
427
		}
428
		if ( !count( $ops ) ) {
429
			return $this->newStatus(); // nothing to do
430
		}
431
432
		$ops = $this->resolveFSFileObjects( $ops );
433
		if ( empty( $opts['force'] ) ) { // sanity
434
			unset( $opts['nonLocking'] );
435
		}
436
437
		/** @noinspection PhpUnusedLocalVariableInspection */
438
		$scope = $this->getScopedPHPBehaviorForOps(); // try to ignore client aborts
439
440
		return $this->doOperationsInternal( $ops, $opts );
441
	}
442
443
	/**
444
	 * @see FileBackend::doOperations()
@@ 662-679 (lines=18) @@
659
	 * @return StatusValue
660
	 * @since 1.20
661
	 */
662
	final public function doQuickOperations( array $ops, array $opts = [] ) {
663
		if ( empty( $opts['bypassReadOnly'] ) && $this->isReadOnly() ) {
664
			return $this->newStatus( 'backend-fail-readonly', $this->name, $this->readOnly );
665
		}
666
		if ( !count( $ops ) ) {
667
			return $this->newStatus(); // nothing to do
668
		}
669
670
		$ops = $this->resolveFSFileObjects( $ops );
671
		foreach ( $ops as &$op ) {
672
			$op['overwrite'] = true; // avoids RTTs in key/value stores
673
		}
674
675
		/** @noinspection PhpUnusedLocalVariableInspection */
676
		$scope = $this->getScopedPHPBehaviorForOps(); // try to ignore client aborts
677
678
		return $this->doQuickOperationsInternal( $ops );
679
	}
680
681
	/**
682
	 * @see FileBackend::doQuickOperations()