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

$collection->addPayment throws an SephpaInputException without the method declaring so #44

Open
ysbrandB opened this issue Oct 21, 2024 · 1 comment

Comments

@ysbrandB
Copy link

ysbrandB commented Oct 21, 2024

In our code we use the Sepha Package.
Currently, the different implementations of the addPayment method declare that they throw an SephpaInputException (ie SepaDirectDebit00800102::addPayment() throws a SephaInputException);

However, the interface SepaPaymentCollection in SepaPaymentCollection.php does not declare this.
Therefore when creating a collection usingphp $directDebit = new SephpaDirectDebit($initgPty, $msgId, SephpaDirectDebit::SEPA_PAIN_008_001_02); Then adding a collection and calling ->addPayment on that collection does not warn you that it throws an error. Therefore your editor also thinks that try { $collection->addPayment([ ]); } catch (SephpaInputException $e) { } is redundant.
It would be nice if the interface also declares the '@ throws' in the php doc comment, as all implementations can throw it.

@AbcAeffchen
Copy link
Owner

Thanks for the report. I have a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants