Fix and improve PHPDoc type hints in FileBackend and FileRepo
[lhc/web/wiklou.git] / includes / filebackend / FileBackendGroup.php
index 8182d62..454b633 100644 (file)
@@ -91,7 +91,7 @@ class FileBackendGroup {
                        // Get the FS backend configuration
                        $autoBackends[] = [
                                'name' => $backendName,
-                               'class' => 'FSFileBackend',
+                               'class' => FSFileBackend::class,
                                'lockManager' => 'fsLockManager',
                                'containerPaths' => [
                                        "{$repoName}-public" => "{$directory}",
@@ -112,7 +112,7 @@ class FileBackendGroup {
        /**
         * Register an array of file backend configurations
         *
-        * @param array $configs
+        * @param array[] $configs
         * @param string|null $readOnlyReason
         * @throws InvalidArgumentException
         */
@@ -155,7 +155,7 @@ class FileBackendGroup {
                        $config = $this->config( $name );
 
                        $class = $config['class'];
-                       if ( $class === 'FileBackendMultiWrite' ) {
+                       if ( $class === FileBackendMultiWrite::class ) {
                                foreach ( $config['backends'] as $index => $beConfig ) {
                                        if ( isset( $beConfig['template'] ) ) {
                                                // Config is just a modified version of a registered backend's.
@@ -190,9 +190,9 @@ class FileBackendGroup {
                        'wikiId' => wfWikiID(), // e.g. "my_wiki-en_"
                        'mimeCallback' => [ $this, 'guessMimeInternal' ],
                        'obResetFunc' => 'wfResetOutputBuffers',
-                       'streamMimeFunc' => [ 'StreamFile', 'contentTypeFromPath' ],
+                       'streamMimeFunc' => [ StreamFile::class, 'contentTypeFromPath' ],
                        'tmpDirectory' => wfTempDir(),
-                       'statusWrapper' => [ 'Status', 'wrap' ],
+                       'statusWrapper' => [ Status::class, 'wrap' ],
                        'wanCache' => MediaWikiServices::getInstance()->getMainWANObjectCache(),
                        'srvCache' => ObjectCache::getLocalServerInstance( 'hash' ),
                        'logger' => LoggerFactory::getInstance( 'FileOperation' ),
@@ -202,7 +202,7 @@ class FileBackendGroup {
                        LockManagerGroup::singleton( $config['wikiId'] )->get( $config['lockManager'] );
                $config['fileJournal'] = isset( $config['fileJournal'] )
                        ? FileJournal::factory( $config['fileJournal'], $name )
-                       : FileJournal::factory( [ 'class' => 'NullFileJournal' ], $name );
+                       : FileJournal::factory( [ 'class' => NullFileJournal::class ], $name );
 
                return $config;
        }