smartemailing / types

Missing data types for PHP. Highly extendable.
Other
89 stars 12 forks source link

Iban #114

Closed aleswita closed 1 year ago

aleswita commented 1 year ago

@slischka what you think about adding jschaedl/iban-validation dependency using in Iban type from required section in composer to suggestion?

Constructor in Iban type will be like below:


public function __construct(
    string $value
)
{

    if (!\class_exists(\Iban\Validation\Iban::class) || !\class_exists(\Iban\Validation\Iban::class)) {
        throw new \Exception('For using ' . self::class . ' type, please require "jschaedl/iban-validation" in your project composer.')
    }

    $this->iban = new \Iban\Validation\Iban($value);
    $validator = new Validator();

    ...
slischka commented 1 year ago

It can be, but this is a BC break, the one who is using it now and doesn't read the readme, would crash the application, for example FAPI. But we can easily make it possible. Add it to suggestion.

aleswita commented 1 year ago

closed by https://github.com/smartemailing/types/pull/115