12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace App\Modules\Message;
- /**
- * 消息通知
- *
- * @method static \App\Modules\Message\MailNotify mail(array $data)
- */
- class MessageNotify
- {
- private static $model_names = [
- 'mail' => 'MailNotify',
- ];
- /**
- * @param string $name
- * @param array $config
- *
- */
- public static function make($name, array $config)
- {
- $namespace = self::$model_names[$name];
- $application = "\\App\\Modules\\Message\\{$namespace}";
- return new $application($config);
- }
- /**
- * Dynamically pass methods to the application.
- *
- * @param string $name
- * @param array $arguments
- *
- * @return mixed
- */
- public static function __callStatic($name, $arguments)
- {
- return self::make($name, ...$arguments);
- }
- }
|