Code style

This commit is contained in:
bkrukowski 2016-09-23 21:46:00 +02:00
parent fda0dffdbc
commit f499bd0fc6
2 changed files with 5 additions and 4 deletions

View File

@ -14,6 +14,7 @@ abstract class MultiDomain implements ServiceInterface
if (!$this->isCaseSensitive()) {
$email = strtolower($email);
}
return explode('@', $email)[0] . '@' . $this->getPrimaryDomain();
}

View File

@ -16,12 +16,12 @@ class TransparentEmail
/**
* @var bool
*/
private $caseSensitiveLocalPart;
private $caseSensitive;
public function __construct(ServiceCollectorInterface $services = null, bool $caseSensitiveLocalPart = false)
public function __construct(ServiceCollectorInterface $services = null, bool $caseSensitive = false)
{
$this->services = $services ?: new DefaultServiceCollector();
$this->caseSensitiveLocalPart = $caseSensitiveLocalPart;
$this->caseSensitive = $caseSensitive;
}
/**
@ -32,7 +32,7 @@ class TransparentEmail
public function getPrimaryEmail(string $email)
{
$this->validateEmailAddress($email);
if (!$this->caseSensitiveLocalPart) {
if (!$this->caseSensitive) {
$email = strtolower($email);
}
$domain = strtolower(explode('@', $email)[1]);