Block: Remove unnecessary lines related to old use of Block::prevents
authorThalia <thalia.e.chan@googlemail.com>
Wed, 20 Feb 2019 10:40:59 +0000 (10:40 +0000)
committerKrinkle <krinklemail@gmail.com>
Thu, 21 Feb 2019 20:16:54 +0000 (20:16 +0000)
Block::prevents simply returns true for 'edit'. In Block::newLoad,
prevents was called as a setter with 'edit', but there was nothing
to set - this call was removed in I0e1316964192113. This patch
removes some more lines related to that call.

Originally added in r84475 (6dbcdc1be097) for T15611.

Change-Id: I8778229d7adfcdee9e21cf560462ef7e7d1c67b3

includes/Block.php

index 11dbcd1..1a54394 100644 (file)
@@ -375,9 +375,6 @@ class Block {
                # Lower will be better
                $bestBlockScore = 100;
 
-               # This is begging for $this = $bestBlock, but that's not allowed in PHP :(
-               $bestBlockPreventsEdit = null;
-
                foreach ( $res as $row ) {
                        $block = self::newFromRow( $row );
 
@@ -409,7 +406,6 @@ class Block {
                        if ( $score < $bestBlockScore ) {
                                $bestBlockScore = $score;
                                $bestRow = $row;
-                               $bestBlockPreventsEdit = $block->appliesToRight( 'edit' );
                        }
                }