Files
kiri-wchat/wx/WxFactory.php
T

28 lines
462 B
PHP
Raw Permalink Normal View History

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