Fix TypeError when reading the minimal SEPA direct debit lead time - #580
Open
renky wants to merge 1 commit into
Open
Fix TypeError when reading the minimal SEPA direct debit lead time#580renky wants to merge 1 commit into
renky wants to merge 1 commit into
Conversation
MinimaleVorlaufzeitSEPALastschrift::create() accepts the two coded fields as
?int, but the properties they are assigned to are typed non-nullable int. Every
caller that omits them therefore raises
TypeError: Cannot assign null to property
MinimaleVorlaufzeitSEPALastschrift::$unterstuetzteSEPALastschriftartenCodiert
of type int
Three call sites inside the library do exactly that:
- ParameterTerminierteSEPAEinzellastschriftEinreichenV1::getMinimalLeadTime()
- ParameterTerminierteSEPAFirmenEinzellastschriftEinreichenV1::getMinimalLeadTime()
- MinimaleVorlaufzeitSEPALastschrift::parseCodedB2B()
So the lead time cannot be read for HIDSES/HIDMES/HIBSES/HIBMES in version 1 at
all, nor for B2B in version 2. Postbank offers all four of those segments only
in version 1 — its own response in the Postbank integration test fixtures
reproduces the error. Version 1 does not transmit the two codes (it states the
lead time per sequence type instead), and the B2B coded format has no field for
the direct debit type, so null is the accurate value in both cases.
Both properties are made nullable, matching the signature of create(). Neither
is read anywhere in the library or its samples, so nothing downstream changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MinimaleVorlaufzeitSEPALastschrift::create() accepts the two coded fields as ?int, but the properties they are assigned to are typed non-nullable int. Every caller that omits them therefore raises
Three call sites inside the library do exactly that:
So the lead time cannot be read for HIDSES/HIDMES/HIBSES/HIBMES in version 1 at all, nor for B2B in version 2. Postbank offers all four of those segments only in version 1 — its own response in the Postbank integration test fixtures reproduces the error. Version 1 does not transmit the two codes (it states the lead time per sequence type instead), and the B2B coded format has no field for the direct debit type, so null is the accurate value in both cases.
Both properties are made nullable, matching the signature of create(). Neither is read anywhere in the library or its samples, so nothing downstream changes.