Reorganizing vcard parsing in preparation for incorporating the Property/
PropertySpecification/PropertyBuilder classes into VCard.
Spent some effort making the handling of line endings and folding/unfolding
standards compliant and updating test cases.
Removed unnecessary testcase added during prototyping.
Added a .gitattributes file to configure handling of line endings. VCards
are required to use CRLF regardless of platform.
Made correction in __get(..) so that non-existant values return null for a
single-value property and an empty array otherwise.
(Re-)added multiple line-ending handling to the new folding functions.
The spec requires that we use CRLF, but in practice, PHP is throwing away the
carriage returns anyway when loading files and existing content is
mixed. Added testcases to ensure that CR, CRLF, LF combinations all work.
Also corrected newline handling for legacy embedded AGENTS.
Added testcases to verify exceptions for mal-formed VCards.
Corrected two issues with dependencies causing tests to be skipped.
Significant refactoring and cleanup of parsing loop, working toward being
able to incorporate ProeprtySpecification/PropertyBuilder into process.
Individual lines of the VCard are now parsed using a regex which ends up
being quite a bit cleaner and can then better handle various kinds of
escaping and combinations of values.
For instance, we now peel off and handle property groups at no additional
cost and we end up correctly parsing a number of parameter types we don't
currently do anything with.
These parameters can then be cleanly handled by PropertyBuilder subtypes
with no additional complexity in the parser loop.
As we now detect and throw exceptions for error conditions we did not
previously look for, adapted testcases to recognize and check for those
exceptions (e.g. malformed parameters and empty property values).
All testcases now pass again.
Noted several FIXMEs in the source for limitations of the current regex or
parsing loop.