Skip to content

Commit

Permalink
add ValidatorInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
daveearley committed Oct 17, 2017
1 parent e92a4f6 commit e5c5d11
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Validations/DisposableEmailValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace EmailValidation\Validations;

class DisposableEmailValidator extends Validator
class DisposableEmailValidator extends Validator implements ValidatorInterface
{
/**
* @return string
Expand Down
2 changes: 1 addition & 1 deletion src/Validations/EmailHostValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace EmailValidation\Validations;

class EmailHostValidator extends Validator
class EmailHostValidator extends Validator implements ValidatorInterface
{
/**
* @return string
Expand Down
2 changes: 1 addition & 1 deletion src/Validations/FreeEmailServiceValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace EmailValidation\Validations;

class FreeEmailServiceValidator extends Validator
class FreeEmailServiceValidator extends Validator implements ValidatorInterface
{
/**
* @return string
Expand Down
2 changes: 1 addition & 1 deletion src/Validations/MisspelledEmailValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Adapted from: https://github.com/GromNaN/MailCheck
*/
class MisspelledEmailValidator extends Validator
class MisspelledEmailValidator extends Validator implements ValidatorInterface
{
const MINIMUM_WORD_DISTANCE_DOMAIN = 2;
const MINIMUM_WORD_DISTANCE_TLD = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/Validations/MxRecordsValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace EmailValidation\Validations;

class MxRecordsValidator extends Validator
class MxRecordsValidator extends Validator implements ValidatorInterface
{
/**
* @return string
Expand Down
2 changes: 1 addition & 1 deletion src/Validations/RoleBasedEmailValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace EmailValidation\Validations;

class RoleBasedEmailValidator extends Validator
class RoleBasedEmailValidator extends Validator implements ValidatorInterface
{
/**
* @return string
Expand Down
2 changes: 1 addition & 1 deletion src/Validations/ValidFormatValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace EmailValidation\Validations;

class ValidFormatValidator extends Validator
class ValidFormatValidator extends Validator implements ValidatorInterface
{
/**
* @return string
Expand Down
10 changes: 0 additions & 10 deletions src/Validations/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ public function __construct(EmailAddress $emailAddress = null, EmailDataProvider
$this->emailDataProvider = $emailDataProvider;
}

/**
* @return mixed
*/
abstract public function getResultResponse();

/**
* @return string
*/
abstract public function getValidatorName(): string;

/**
* @return EmailAddress
*/
Expand Down
18 changes: 18 additions & 0 deletions src/Validations/ValidatorInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace EmailValidation\Validations;

interface ValidatorInterface
{
/**
* @return mixed
*/
public function getResultResponse();

/**
* @return string
*/
public function getValidatorName(): string;
}

0 comments on commit e5c5d11

Please sign in to comment.