2022-09-09 16:42:55 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace wchat\wx;
|
|
|
|
|
|
|
|
|
|
use Kiri\Di\Container;
|
2023-07-11 21:04:33 +08:00
|
|
|
use ReflectionException;
|
2023-11-14 09:20:29 +08:00
|
|
|
use wchat\common\AppConfig;
|
2022-09-09 16:42:55 +08:00
|
|
|
|
|
|
|
|
class QqFactory
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
2023-07-11 21:04:33 +08:00
|
|
|
/**
|
|
|
|
|
* @param $class
|
2023-11-14 09:20:29 +08:00
|
|
|
* @param AppConfig $config
|
2023-07-11 21:04:33 +08:00
|
|
|
* @return mixed
|
|
|
|
|
* @throws ReflectionException
|
|
|
|
|
*/
|
2023-11-14 09:20:29 +08:00
|
|
|
public static function get($class, AppConfig $config): mixed
|
2022-09-09 16:42:55 +08:00
|
|
|
{
|
2023-07-11 21:04:33 +08:00
|
|
|
$container = Container::instance();
|
2022-09-09 16:42:55 +08:00
|
|
|
$object = $container->get($class);
|
2023-11-14 01:12:03 +08:00
|
|
|
$object->setPayConfig($config);
|
2022-09-09 16:42:55 +08:00
|
|
|
return $object;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|