29 lines
478 B
PHP
29 lines
478 B
PHP
<?php
|
|
|
|
namespace wchat\wx;
|
|
|
|
use Kiri\Di\Container;
|
|
use ReflectionException;
|
|
use wchat\common\Config;
|
|
|
|
class WxFactory
|
|
{
|
|
|
|
|
|
/**
|
|
* @param $class
|
|
* @param Config $config
|
|
* @return object|null
|
|
* @throws ReflectionException
|
|
*/
|
|
public static function get($class, Config $config): ?object
|
|
{
|
|
$container = Container::instance();
|
|
$object = $container->get($class);
|
|
$object->setConfig($config);
|
|
return $object;
|
|
}
|
|
|
|
|
|
}
|