Services: Convert BlockManager's static to a const now HHVM is gone
[lhc/web/wiklou.git] / includes / block / BlockManager.php
index 4c2f27e..be09665 100644 (file)
@@ -49,12 +49,10 @@ class BlockManager {
        private $options;
 
        /**
-        * TODO Make this a const when HHVM support is dropped (T192166)
-        *
         * @var array
         * @since 1.34
         */
-       public static $constructorOptions = [
+       public const CONSTRUCTOR_OPTIONS = [
                'ApplyIpBlocksToXff',
                'CookieSetOnAutoblock',
                'CookieSetOnIpBlock',
@@ -79,7 +77,7 @@ class BlockManager {
                PermissionManager $permissionManager,
                LoggerInterface $logger
        ) {
-               $options->assertRequiredOptions( self::$constructorOptions );
+               $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
                $this->options = $options;
                $this->permissionManager = $permissionManager;
                $this->logger = $logger;
@@ -455,12 +453,14 @@ class BlockManager {
                                                // TODO: Improve on simply tracking the first trackable block (T225654)
                                                foreach ( $block->getOriginalBlocks() as $originalBlock ) {
                                                        if ( $this->shouldTrackBlockWithCookie( $originalBlock, $isAnon ) ) {
+                                                               '@phan-var DatabaseBlock $originalBlock';
                                                                $this->setBlockCookie( $originalBlock, $response );
                                                                return;
                                                        }
                                                }
                                        } else {
                                                if ( $this->shouldTrackBlockWithCookie( $block, $isAnon ) ) {
+                                                       '@phan-var DatabaseBlock $block';
                                                        $this->setBlockCookie( $block, $response );
                                                }
                                        }