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