mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
Replace empty() with falsy check
empty() should only be used to suppress errors Found by a new phan plugin (T234237) Change-Id: I3a2c86e0f83ec49cbd6af3ad30ecd0a663b761a0
This commit is contained in:
parent
ceb2da0f60
commit
bdbd65ffae
|
@ -43,20 +43,9 @@ class ResourceLoaderEchoImageModule extends RL\ImageModule {
|
|||
foreach ( $this->definition['icons'] as $iconName => $definition ) {
|
||||
// FIXME: We also have a 'site' icon which is "magical"
|
||||
// and uses witchcraft and should be handled specifically
|
||||
if ( isset( $definition[ 'path' ] ) ) {
|
||||
if ( is_array( $definition[ 'path' ] ) ) {
|
||||
$paths = [];
|
||||
foreach ( $definition[ 'path' ] as $dir => $p ) {
|
||||
// Has both rtl and ltr definitions
|
||||
$paths[ $dir ] = $p;
|
||||
}
|
||||
} else {
|
||||
$paths = $definition[ 'path' ];
|
||||
}
|
||||
|
||||
if ( !empty( $paths ) ) {
|
||||
$images[ $iconName ][ 'file' ] = $paths;
|
||||
}
|
||||
if ( isset( $definition[ 'path' ] ) && $definition[ 'path' ] ) {
|
||||
// string or array, if array, has both rtl and ltr definitions
|
||||
$images[ $iconName ][ 'file' ] = $definition[ 'path' ];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue