Add BIC support. This fixes #430

This commit is contained in:
James Cole
2016-11-28 18:55:56 +01:00
parent 8279cf0e88
commit 8cdbc96aa5
9 changed files with 33 additions and 7 deletions

View File

@@ -57,8 +57,6 @@ class FireflyValidator extends Validator
* @param $value
*
* @return bool
* @internal param $parameters
*
*
*/
public function validate2faCode($attribute, $value): bool
@@ -95,6 +93,27 @@ class FireflyValidator extends Validator
}
/**
* @param $attribute
* @param $value
*
* @return bool
*
*/
public function validateBic($attribute, $value): bool
{
$regex = '/^[a-z]{6}[0-9a-z]{2}([0-9a-z]{3})?\z/i';
$result = preg_match($regex, $value);
if ($result === false) {
return false;
}
if ($result === 0) {
return false;
}
return true;
}
/**
* @param $attribute
* @param $value