Respect\Validation\Rules\Locale\Factory::bank PHP Method

bank() public method

public bank ( $countryCode ) : Respect\Validation\Validatable
return Respect\Validation\Validatable
    public function bank($countryCode)
    {
        $filteredCountryCode = mb_strtoupper($countryCode);
        switch ($filteredCountryCode) {
            case 'DE':
                return new GermanBank();
            default:
                throw new ComponentException(sprintf('Cannot provide bank validation for country "%s"', $countryCode));
        }
    }

Usage Example

コード例 #1
0
ファイル: Bank.php プロジェクト: powerpbx/framework
 /**
  * Defines the country code.
  *
  * The country code is not case sensitive.
  *
  * @param string  $countryCode The ISO 639-1 country code.
  * @param Factory $factory
  */
 public function __construct($countryCode, Factory $factory = null)
 {
     if (null === $factory) {
         $factory = new Factory();
     }
     $this->validatable = $factory->bank($countryCode);
 }
All Usage Examples Of Respect\Validation\Rules\Locale\Factory::bank