Spomky-Labs / cbor-php

CBOR Encoder/Decoder for PHP
MIT License
42 stars 11 forks source link

Fixed #29 #30

Closed MaximilianKresse closed 3 years ago

MaximilianKresse commented 3 years ago

See #29

The renaming of EpochTag is not included because it would be a BC break.

Spomky commented 3 years ago

Hi,

Thank you for this PR. I dig into this bug and it seems that this constant has some issues too when using 6 digits for microseconds. See https://www.php.net/manual/en/datetime.createfromformat.php#121431

The formqt Y-m-d\TH:i:s.uP seems to be appropriate. Also, would you mind to add some tests to make sure this bug is correctly covered?

Many thanks. Regards.

MaximilianKresse commented 3 years ago

I've fixed the problem with 6 digits for microseconds and added some tests for this problem.

Spomky commented 3 years ago

Hi,

Many thanks for the changes. I am not a big fan of mocks, anyway I now merge it and will update the tests later