123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- declare(strict_types=1);
- namespace app\common\lib;
- class ClassArr
- {
- public static function smsClassStat(): array
- {
- return [
- "ali" => "app\common\lib\sms\AliSms",
- "baidu" => "app\common\lib\sms\BaiduSms",
- "jd" => "app\common\lib\sms\JdSms",
- ];
- }
- public static function uploadClassStat(): array
- {
- return [
- 'text' => 'xxx',
- 'image' => 'xxx',
- ];
- }
-
- public static function initClass(string $type, array $class, array $params = [], bool $needInstance = false)
- {
-
-
- if (!array_key_exists($type, $class)) {
- return false;
- }
- $className = $class[$type];
-
-
- return $needInstance === true ? (new \ReflectionClass('AliSms'))->newInstanceArgs($params) : $className;
- }
- }
|