X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2FRepoGroup.php;h=fa4567e0b2cb22b9587e3da58a4d520640d03400;hb=941e3c66ba67863278bc11b9c0a23e47abfadefe;hp=b7977900a32e643193b40528584d5f6c77df48e8;hpb=172925ae62e912c1e5484c05473662a45f0055ef;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index b7977900a3..fa4567e0b2 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -140,7 +140,7 @@ class RepoGroup { && empty( $options['private'] ) && empty( $options['latest'] ) ) { - $time = isset( $options['time'] ) ? $options['time'] : ''; + $time = $options['time'] ?? ''; if ( $this->cache->has( $dbkey, $time, 60 ) ) { return $this->cache->get( $dbkey, $time ); } @@ -163,7 +163,7 @@ class RepoGroup { } } - $image = $image ? $image : false; // type sanity + $image = $image ?: false; // type sanity # Cache file existence or non-existence if ( $useCache && ( !$image || $image->isCacheable() ) ) { $this->cache->set( $dbkey, $time, $image ); @@ -324,11 +324,8 @@ class RepoGroup { } if ( $index === 'local' ) { return $this->localRepo; - } elseif ( isset( $this->foreignRepos[$index] ) ) { - return $this->foreignRepos[$index]; - } else { - return false; } + return $this->foreignRepos[$index] ?? false; } /** @@ -372,8 +369,7 @@ class RepoGroup { $this->initialiseRepos(); } foreach ( $this->foreignRepos as $repo ) { - $args = array_merge( [ $repo ], $params ); - if ( call_user_func_array( $callback, $args ) ) { + if ( $callback( $repo, ...$params ) ) { return true; } }