&& 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 );
}
}
}
- $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 );
}
if ( $index === 'local' ) {
return $this->localRepo;
- } elseif ( isset( $this->foreignRepos[$index] ) ) {
- return $this->foreignRepos[$index];
- } else {
- return false;
}
+ return $this->foreignRepos[$index] ?? false;
}
/**
$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;
}
}