27 lines
365 B
PHP
27 lines
365 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace wchat\wx;
|
||
|
|
|
||
|
|
use Kiri\Di\Container;
|
||
|
|
use wchat\common\Config;
|
||
|
|
|
||
|
|
class QqFactory
|
||
|
|
{
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param $class
|
||
|
|
* @param Config $config
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public static function get($class, Config $config): mixed
|
||
|
|
{
|
||
|
|
$container = Container::getInstance();
|
||
|
|
$object = $container->get($class);
|
||
|
|
$object->setConfig($config);
|
||
|
|
return $object;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|