Files
piratepoet/lib/API/API.php
Ján Mikláš 3ee58aea10 Add space between if and ‘(‘
[MAILPOET-1791]
2019-02-13 08:26:27 -05:00

20 lines
501 B
PHP

<?php
namespace MailPoet\API;
use MailPoet\DI\ContainerWrapper;
use MailPoetVendor\Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
if (!defined('ABSPATH')) exit;
class API {
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'));
}
}
}