示例#1
0
 /**
  * PreferredNotifyWay constructor.
  * @param string $value
  * @throws AssertException
  */
 public function __construct($value)
 {
     Assert::assertsIsInArray($value, $this->getOptions());
     $this->value = $value;
 }
示例#2
0
文件: basic.php 项目: jlaso/assert
<?php

include_once __DIR__ . "/../vendor/autoload.php";
use JLaso\Assert\Assert;
Assert::assertsIsAnEmail("*****@*****.**");
Assert::assertsIsAnEmail("This-is-not-an-email");
// throws an Exception
示例#3
0
文件: Email.php 项目: jlaso/notify
 /**
  * Email constructor.
  * @param string $email
  * @throws AssertException
  */
 public function __construct($email)
 {
     $email = trim(strtolower($email));
     Assert::assertsIsAnEmail($email);
     $this->value = $email;
 }