Toplan\PhpSms\Sms::make PHP Method

make() public static method

Create a sms instance send SMS, your can also set SMS templates or content at the same time.
public static make ( mixed $agentName = null, mixed $tempId = null ) : Sms
$agentName mixed
$tempId mixed
return Sms
    public static function make($agentName = null, $tempId = null)
    {
        $sms = new self();
        $sms->smsData['type'] = self::TYPE_SMS;
        if (is_array($agentName)) {
            $sms->template($agentName);
        } elseif ($agentName && is_string($agentName)) {
            if ($tempId === null) {
                $sms->content($agentName);
            } elseif (is_string($tempId) || is_int($tempId)) {
                $sms->template($agentName, "{$tempId}");
            }
        }
        return $sms;
    }

Usage Example

Example #1
0
 public function testValidator()
 {
     $method = self::getPrivateMethod('validator');
     $obj = Sms::make()->to('18280000000');
     $r = $method->invokeArgs($obj, []);
     $this->assertTrue($r);
 }
All Usage Examples Of Toplan\PhpSms\Sms::make