* @code
* $modules['foo'] = 'ApiFoo';
* $modules['bar'] = [
- * 'class' => 'ApiBar',
+ * 'class' => ApiBar::class,
* 'factory' => function( $main, $name ) { ... }
* ];
* $modules['xyzzy'] = [
- * 'class' => 'ApiXyzzy',
- * 'factory' => [ 'XyzzyFactory', 'newApiModule' ]
+ * 'class' => ApiXyzzy::class,
+ * 'factory' => [ XyzzyFactory::class, 'newApiModule' ]
* ];
* @endcode
*
foreach ( $modules as $name => $moduleSpec ) {
if ( is_array( $moduleSpec ) ) {
$class = $moduleSpec['class'];
- $factory = ( isset( $moduleSpec['factory'] ) ? $moduleSpec['factory'] : null );
+ $factory = ( $moduleSpec['factory'] ?? null );
} else {
$class = $moduleSpec;
$factory = null;