// Hook can determine default model
$title = Title::newFromLinkTarget( $page );
- if ( !Hooks::run( 'ContentHandlerDefaultModelFor', [ $title, &$model ] ) ) {
- if ( !is_null( $model ) ) {
- return $model;
- }
+ if ( !Hooks::run( 'ContentHandlerDefaultModelFor', [ $title, &$model ] ) && !is_null( $model ) ) {
+ return $model;
}
// Could this page contain code based on the title?
case 'json':
return CONTENT_MODEL_JSON;
default:
- return is_null( $model ) ? CONTENT_MODEL_TEXT : $model;
+ return $model ?? CONTENT_MODEL_TEXT;
}
}