Example #1
0
 /**
  * PreferredNotifyWay constructor.
  * @param string $value
  * @throws AssertException
  */
 public function __construct($value)
 {
     Assert::assertsIsInArray($value, $this->getOptions());
     $this->value = $value;
 }
Example #2
0
<?php

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