kmukku / php-iso11649

ISO 11649 creditor reference library for php
11 stars 5 forks source link

Use full format by default #4

Open glenncoppens opened 4 years ago

glenncoppens commented 4 years ago

Hi,

What do you think?

Thanks, Glenn

kmukku commented 4 years ago

Hi,

Thanks for the fix and tests. You are right about issue with digital vs. print version of the reference. Have any suggestions how we could support both without breaking existing use cases?

kmukku commented 4 years ago

We could probably assume that when $chunksplit = false, it's ok to return the digital version. What do you think?

glenncoppens commented 4 years ago

@kmukku

Hmm, I think using some kind of string formatter should be the ultimate goal. A default formatter will be available ('digital' and 'human readable'), but a custom formatter can be injected. That way the dev can define its own format if needed (might not be necessary).

To achieve this, I think it might be best to mark the current generateRfReference-method as deprecated in the coming minor/patch releases. Meanwhile create a new method that uses the above formatter approach (or something likewise).

When the formatter approach is working properly in these minor releases, release a major version (backwards incompatible) with the other/old method being removed.

kmukku commented 4 years ago

Sounds good... also maybe third parameter to generateRfReference could be the format and it defaults to format that we have now. That way we don't need to deprecate it.