Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add the support for SWIFT Business Identifier Code (BIC) format #58

Merged
merged 3 commits into from
Jan 6, 2021

Conversation

codisart
Copy link
Contributor

Q A
Documentation yes
BC Break no
New Feature yes

Description

Implementation proposal for #20

@codisart codisart force-pushed the feat-support-bic-validation branch 2 times, most recently from dc11913 to f1c422b Compare March 28, 2020 17:55
docs/book/validators/bic.md Outdated Show resolved Hide resolved
@codisart codisart force-pushed the feat-support-bic-validation branch from f1c422b to 56c6fc6 Compare March 29, 2020 13:11
Copy link
Member

@michalbundyra michalbundyra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codisart Thanks a lot for your contribution. I've added some comments.
We need also rebase and target develop as it is new feature and can be released in next minor. Thanks 👍

docs/book/validators/bic.md Outdated Show resolved Hide resolved
src/BusinessIdentifierCode.php Show resolved Hide resolved
src/BusinessIdentifierCode.php Outdated Show resolved Hide resolved
src/BusinessIdentifierCode.php Outdated Show resolved Hide resolved
src/BusinessIdentifierCode.php Outdated Show resolved Hide resolved
test/BusinessIdentifierCodeTest.php Outdated Show resolved Hide resolved
test/BusinessIdentifierCodeTest.php Outdated Show resolved Hide resolved
test/BusinessIdentifierCodeTest.php Outdated Show resolved Hide resolved
test/BusinessIdentifierCodeTest.php Outdated Show resolved Hide resolved
test/BusinessIdentifierCodeTest.php Outdated Show resolved Hide resolved
@codisart codisart changed the base branch from master to develop March 29, 2020 21:49
@codisart codisart force-pushed the feat-support-bic-validation branch from 56c6fc6 to 69f9ae6 Compare March 30, 2020 21:51
@michalbundyra michalbundyra added this to the 2.14.0 milestone Mar 30, 2020
Copy link
Member

@froschdesign froschdesign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good extension for this component! 👍

I added some small comments and suggestions.

src/BusinessIdentifierCode.php Outdated Show resolved Hide resolved
src/BusinessIdentifierCode.php Show resolved Hide resolved
self::NOT_VALID_COUNTRY => 'Invalid country code',
];

private const REGEX_BIC = '/^[a-z]{4}(?<country>[a-z]{2})[0-9a-z]{2}([0-9a-z]{3})?$/i';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same here, if there are an official pattern then a link should be added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pattern is defined in the wikipedia page. Would it be sufficient ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the pattern is adopted, we should add the reference, and if the official specification is behind a paywall, Wikimedia is good.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've found a regex provided by the "Bundesbank" in this PDF:

https://www.bundesbank.de/resource/blob/749660/d2c6e00664251b4d83483c229e084e44/mL/technische-spezifikationen-scc-anhang-112018-data.pdf

Page 39. Maybe we might use that regex instead or we have a better "official" resource.

docs/book/validators/bic.md Outdated Show resolved Hide resolved
docs/book/validators/bic.md Outdated Show resolved Hide resolved
docs/book/validators/bic.md Outdated Show resolved Hide resolved
docs/book/validators/bic.md Outdated Show resolved Hide resolved
docs/book/validators/bic.md Outdated Show resolved Hide resolved
@codisart codisart force-pushed the feat-support-bic-validation branch from 69f9ae6 to 18838b0 Compare March 31, 2020 11:58
@codisart codisart force-pushed the feat-support-bic-validation branch 2 times, most recently from eb5d64a to 4a0d359 Compare April 4, 2020 21:38
@codisart
Copy link
Contributor Author

Hello @froschdesign and @michalbundyra, are my last changes ok with your recommendations ?

@codisart
Copy link
Contributor Author

Hello @froschdesign and @michalbundyra, are there changes needed to this pull request ?

@geerteltink geerteltink changed the base branch from develop to 2.14.x September 12, 2020 07:48
@codisart codisart requested a review from michalbundyra October 1, 2020 20:31
@boesing boesing removed this from the 2.14.0 milestone Nov 18, 2020
@codisart
Copy link
Contributor Author

Hello @boesing,

I see that you removed the PR from the 2.14 milestone.
What branch should I use to rebase against now ?
What can I do to help to merge this PR ?

@boesing
Copy link
Member

boesing commented Nov 18, 2020

@codisart I did not dive very deep into this but there are some change requests in here which will probably block the release of 2.14.0.
As #75 will contain PHP 8 support, I'd like to release this component as far as anything regarding PHP 8 is ready.

After the release, we can re-target this branch to 2.15.
However, as stated here, we might want to use official documentation as references when applying RegExp.

@weierophinney weierophinney added this to the 2.14.0 milestone Jan 6, 2021
codisart and others added 3 commits January 6, 2021 15:13
- 1 line per sentence
- Use `-` for bullets (not `*`)
- Add whitespace after headings

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
This patch updates the REGEX_BIC constant to follow the documentation from the bundesbank.
The main changes are that the two characters following the country code have more restrictions (the first cannot contain the digit 1, the second cannot contain the letter "o").
A comment with a link to the documentation (and reference to the page) is provided.

CS was also indicating we had two unused import statements, so I removed those.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@weierophinney weierophinney force-pushed the feat-support-bic-validation branch from 4a0d359 to 5ff51fb Compare January 6, 2021 21:19
@weierophinney
Copy link
Member

I updated the REGEX to follow the BundesBank documentation (it was just some minor changes). I also did some cleanup on the documentation.

@weierophinney weierophinney merged commit 3a5a338 into laminas:2.14.x Jan 6, 2021
weierophinney added a commit that referenced this pull request Jan 6, 2021
Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@gsteel gsteel mentioned this pull request Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants