resourceloader: Add type hints for type ResourceLoaderContext
authorFomafix <fomafix@googlemail.com>
Fri, 27 Sep 2019 04:43:44 +0000 (06:43 +0200)
committerFomafix <fomafix@googlemail.com>
Fri, 27 Sep 2019 04:43:44 +0000 (06:43 +0200)
Change-Id: I10fc4b9277f94fc495149fe0d0077b054090387b

includes/resourceloader/ResourceLoaderFileModule.php
includes/resourceloader/ResourceLoaderModule.php
includes/resourceloader/ResourceLoaderStartUpModule.php

index 23a9a14..f77f06c 100644 (file)
@@ -906,7 +906,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         *     keyed by media type
         * @throws MWException
         */
-       public function readStyleFiles( array $styles, $flip, $context ) {
+       public function readStyleFiles( array $styles, $flip, ResourceLoaderContext $context ) {
                if ( !$styles ) {
                        return [];
                }
@@ -933,7 +933,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         * @return string CSS data in script file
         * @throws MWException If the file doesn't exist
         */
-       protected function readStyleFile( $path, $flip, $context ) {
+       protected function readStyleFile( $path, $flip, ResourceLoaderContext $context ) {
                $localPath = $this->getLocalPath( $path );
                $remotePath = $this->getRemotePath( $path );
                if ( !file_exists( $localPath ) ) {
@@ -973,7 +973,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         * @param ResourceLoaderContext $context
         * @return bool
         */
-       public function getFlip( $context ) {
+       public function getFlip( ResourceLoaderContext $context ) {
                return $context->getDirection() === 'rtl' && !$this->noflip;
        }
 
index c9fd267..674fe89 100644 (file)
@@ -128,7 +128,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         * @param ResourceLoaderContext $context
         * @return bool
         */
-       public function getFlip( $context ) {
+       public function getFlip( ResourceLoaderContext $context ) {
                return MediaWikiServices::getInstance()->getContentLanguage()->getDir() !==
                        $context->getDirection();
        }
index 78775fb..a29f6e0 100644 (file)
@@ -58,7 +58,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
         * @param ResourceLoaderContext $context
         * @return array
         */
-       private function getConfigSettings( $context ) {
+       private function getConfigSettings( ResourceLoaderContext $context ) {
                $conf = $this->getConfig();
 
                /**