Page MenuHomeWickedGov Phorge

Math.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

Math.php

<?php
namespace MediaWiki\Extension\Math;
use MediaWiki\Extension\Math\InputCheck\InputCheckFactory;
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\VisitorFactory;
use MediaWiki\MediaWikiServices;
use Psr\Container\ContainerInterface;
/**
* Top level factory for the Math extension.
*
* @license GPL-2.0-or-later
*/
final class Math {
/**
* @codeCoverageIgnore
*/
private function __construct() {
// should not be instantiated
}
public static function getMathConfig( ?ContainerInterface $services = null ): MathConfig {
return self::getService( 'Math.Config', $services );
}
public static function getCheckerFactory( ?ContainerInterface $services = null ): InputCheckFactory {
return self::getService( 'Math.CheckerFactory', $services );
}
public static function getVisitorFactory( ?ContainerInterface $services = null ): VisitorFactory {
return self::getService( 'Math.MathMLTreeVisitor', $services );
}
/**
* Retrieves a service instance from the specified or default container.
* @param string $serviceName Service identifier to retrieve
* @param ContainerInterface|null $services Optional container override for unit tests
* @return mixed Service instance
*/
private static function getService( string $serviceName, ?ContainerInterface $services = null ) {
return ( $services ?? MediaWikiServices::getInstance() )->getService( $serviceName );
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Nov 23, 00:13 (2 d, 11 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
64/2e/1ad7e682b517a0faf30ca7628045
Default Alt Text
Math.php (1 KB)

Event Timeline