Files
piratepoet/lib/API/API.php
Amine Ben hammou 43df66d162 Add public keyword to methods
[MAILPOET-2413]
2019-12-26 18:09:45 +03:00

24 lines
578 B
PHP

<?php
namespace MailPoet\API;
use MailPoet\DI\ContainerWrapper;
use MailPoetVendor\Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
class API {
/**
* @param string $version
* @return \MailPoet\API\MP\v1\API
* @throws \Exception
*/
public static function MP($version) {
$api_class = sprintf('%s\MP\%s\API', __NAMESPACE__, $version);
try {
return ContainerWrapper::getInstance()->get($api_class);
} catch (ServiceNotFoundException $e) {
throw new \Exception(__('Invalid API version.', 'mailpoet'));
}
}
}