for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace tinymeng\mailer;
/**
* Class Name: PHP Mailer类
* @author Tinymeng <[email protected]>
* @date: 2019/9/26 16:49
* @method static \tinymeng\mailer\Gateways\Smtp smtp(array $config) SMTP发送邮件
* @package tinymeng\mailer
*/
class Email
{
* Description: init
* @author: JiaMeng <[email protected]>
* Updater:
* @param $gateway
* @param null $config
$config
null
* @return mixed
* @throws \Exception
protected static function init($gateway, $config = null)
$class = __NAMESPACE__ . '\\Gateways\\' . ucfirst(strtolower($gateway));
if (class_exists($class)) {
$app = new $class($config);
return $app;
}
throw new \Exception("发送Mailer基类 [$gateway] 不存在");
* Description: __callStatic
* @param $config
public static function __callStatic($gateway, $config)
return self::init($gateway, ...$config);
tinymeng\mailer\Email::init()
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
ignore-type
return self::init($gateway, /** @scrutinizer ignore-type */ ...$config);