Code Duplication    Length = 20-23 lines in 2 locations

includes/filebackend/SwiftFileBackend.php 2 locations

@@ 593-615 (lines=23) @@
590
		return $status;
591
	}
592
593
	protected function doSecureInternal( $fullCont, $dir, array $params ) {
594
		$status = Status::newGood();
595
		if ( empty( $params['noAccess'] ) ) {
596
			return $status; // nothing to do
597
		}
598
599
		$stat = $this->getContainerStat( $fullCont );
600
		if ( is_array( $stat ) ) {
601
			// Make container private to end-users...
602
			$status->merge( $this->setContainerAccess(
603
				$fullCont,
604
				[ $this->swiftUser ], // read
605
				[ $this->swiftUser ] // write
606
			) );
607
		} elseif ( $stat === false ) {
608
			$status->fatal( 'backend-fail-usable', $params['dir'] );
609
		} else {
610
			$status->fatal( 'backend-fail-internal', $this->name );
611
			wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' );
612
		}
613
614
		return $status;
615
	}
616
617
	protected function doPublishInternal( $fullCont, $dir, array $params ) {
618
		$status = Status::newGood();
@@ 617-636 (lines=20) @@
614
		return $status;
615
	}
616
617
	protected function doPublishInternal( $fullCont, $dir, array $params ) {
618
		$status = Status::newGood();
619
620
		$stat = $this->getContainerStat( $fullCont );
621
		if ( is_array( $stat ) ) {
622
			// Make container public to end-users...
623
			$status->merge( $this->setContainerAccess(
624
				$fullCont,
625
				[ $this->swiftUser, '.r:*' ], // read
626
				[ $this->swiftUser ] // write
627
			) );
628
		} elseif ( $stat === false ) {
629
			$status->fatal( 'backend-fail-usable', $params['dir'] );
630
		} else {
631
			$status->fatal( 'backend-fail-internal', $this->name );
632
			wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' );
633
		}
634
635
		return $status;
636
	}
637
638
	protected function doCleanInternal( $fullCont, $dir, array $params ) {
639
		$status = Status::newGood();