It would be useful if `ValidSkinNames` accepted ObjectFactory notation. Currently it only accepts "displayname => Class suffix" such as
```lang=json
"ValidSkinNames": {
"monobook": "MonoBook"
},
```
Which means no namespacing or other "complex" setup.
```lang=php
/** @suppress PhanTypeInvalidCallableArraySize - https://github.com/phan/phan/issues/1648 */
'SkinFactory' => function ( MediaWikiServices $services ) : SkinFactory {
$factory = new SkinFactory( $services->getObjectFactory() );
$names = $services->getMainConfig()->get( 'ValidSkinNames' );
foreach ( $names as $name => $skin ) {
$factory->register( $name, $skin, [
'class' => "Skin$skin"
] );
}
// Register a hidden "fallback" skin
$factory->register( 'fallback', 'Fallback', [
'class' => SkinFallback::class
] );
// Register a hidden skin for api output
$factory->register( 'apioutput', 'ApiOutput', [
'class' => SkinApi::class
] );
return $factory;
},
```
Simplest way forward seems to be replacing
```lang=php
foreach ( $names as $name => $skin ) {
$factory->register( $name, $skin, [
'class' => "Skin$skin"
] );
}
```
with something like (noting this won't work due to the display name stuff)
```lang=php
foreach ( $names as $name => $skin ) {
if ( is_array( $skin ) ) {
$spec = $skin;
} else {
$spec = [
'class' => "Skin$skin"
];
}
$factory->register( $name, $skin, $spec );
}
```