for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Jaby\Sms;
class SmsService
{
protected $driver ;
protected $mode ;
protected $class ;
/**
* SmsService constructor.
*/
public function __construct()
$this->driver = config('sms.default');
$this->class = config('sms.map.'.$this->driver);
}
* @param $key
* @return $this
public function driver($key)
$this->driver = $key ;
return $this;
* @param $text
* @return mixed
public function text($text)
$drive = $this->drive('text',[$text]);
return $drive;
* @param null $code
$code
null
public function pattern($code = null)
$drive = $this->drive('pattern',[$code]);
* @param array $params
public function drive($key,$params = [])
$class = new $this->class;
return call_user_func_array(array($class,$key),$params);