- $class = $config['class'];
- $jrn = new $class( $config );
- if ( !$jrn instanceof self ) {
- throw new InvalidArgumentException( "$class is not an instance of " . __CLASS__ );
- }
+ $jrn = ObjectFactory::getObjectFromSpec(
+ $config,
+ [ 'specIsArg' => true, 'assertClass' => __CLASS__ ]
+ );