lockmanager: disable internal QuorumLockManager methods that should never be reached
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 28 Jun 2019 23:55:54 +0000 (16:55 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 28 Jun 2019 23:58:49 +0000 (23:58 +0000)
Change-Id: If19f48f8c2d3fe8a38068b09d8691bc8f4eb5d46

includes/libs/lockmanager/QuorumLockManager.php

index 1ef4642..950b283 100644 (file)
@@ -35,15 +35,7 @@ abstract class QuorumLockManager extends LockManager {
        /** @var array Map of degraded buckets */
        protected $degradedBuckets = []; // (bucket index => UNIX timestamp)
 
-       final protected function doLock( array $paths, $type ) {
-               return $this->doLockByType( [ $type => $paths ] );
-       }
-
-       final protected function doUnlock( array $paths, $type ) {
-               return $this->doUnlockByType( [ $type => $paths ] );
-       }
-
-       protected function doLockByType( array $pathsByType ) {
+       final protected function doLockByType( array $pathsByType ) {
                $status = StatusValue::newGood();
 
                $pathsToLock = []; // (bucket => type => paths)
@@ -278,4 +270,12 @@ abstract class QuorumLockManager extends LockManager {
         * @return StatusValue
         */
        abstract protected function releaseAllLocks();
+
+       final protected function doLock( array $paths, $type ) {
+               throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+       }
+
+       final protected function doUnlock( array $paths, $type ) {
+               throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+       }
 }