jschaedl
Repos
72
Followers
53
Following
54

:bank: A small library for validating International BankAccount Numbers (IBANs)

67
16

Easily switch Homebrew PHP versions on OSX.

222
43

The Symfony PHP framework

27476
8586

The Symfony documentation

1988
4729

Keep your architecture clean.

2060
100

A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.

444
37

Events

issue comment
Iban\Validation\Validator::validate without violations

Hi @tugrul

I made the Validator final on purpose. If I open it for extension, it would be much harder to change any internals in future releases.

I can imagine to add another option to specify, if the Validator should use the violations or if it should throw an exception.

$validator = new Validator(['throw_exceptions' => true]);
try {
    $validator->validate('some iban');
} catch (ValidationException $exception) {
    // ...
}

To your use case:

I don't need any violation list because it does not matter when one of these validations is failed.

Couldn't you use the provided violations instead of the exception messages:

class SomeController extends AbstractController {

    #[Route('/user/iban-review/{iban}', name: 'user-iban-preview')]
    public function previewAction(string $iban): JsonResponse
    {
            $validator = new Validator();

            return $this->json([
                'success' => $success = $validator->validate(new Iban($iban)),
                'result' => $success ? '' : implode(', ', $validator->getViolations()) // you could also just use the first array item
            ], 200, [], ['groups' => ['public']]);
    }
}
Created at 1 month ago

Introduce export bundle

Created at 2 months ago

Introduce export bundle

Created at 2 months ago

Introduce export bundle

Created at 2 months ago
pull request opened
Introduce export bundle
Created at 2 months ago
jschaedl create branch export-bundle
Created at 2 months ago
jschaedl create branch main
Created at 2 months ago
create repository
jschaedl create repository
Created at 2 months ago
Update iban registry

https://www.swift.com/insights/press-releases/swift-instructed-to-disconnect-sanctioned-iranian-banks-following-eu-council-decision

Created at 2 months ago