Closed sebastianlew closed 4 years ago
Thanks for fixing this issue, I have to add some php spec tests for this class I assume.
Could you please share the value causing this bug ? I need to add it to the behat tests (I need to fix the menu taxon missing bug into it first).
@Prometee for every value that doesn't meet regexp condition src/Util/VatNumberUtil.php:43
. E.g. 123
, 123123
etc. But remember that this is just NOTICE. So probably most of users on production environment have disabled this level of error reporting. But still, i think that is annoying problem especially in dev environment.
Could you tag new release with this change on master branch please?
@sebastianlew thanks for the advice, this plugin will require some phpspec tests to avoid this kind of issues in the futur. I'll release a new version this morning and add phpspec during the week.
Again thanks for the PR 😉
@sebastianlew release done, I also refactor a little bit the validator to avoid displaying validation message when the VAT number is not a valid one.
@Prometee It was important for me, thank you for your fast reaction 😄
I'm glad it helped you !
\Prometee\VIESClient\Util\VatNumberUtil::split
can return null.\Prometee\SyliusVIESClientPlugin\Constraints\CountryVatNumberValidator
throws notice then:Notice: Trying to access array offset on value of type null
. In my opinion this kind of behavior isn' t correct. I just simply check for null and then build violation in validator, for me it's better way rather than get unexpected notice in this case.