Closed kukko closed 3 years ago
The tests for PHP 7.2 and 7.1 fails because those does not support trailling comas in function calls. Can I change those tests? Because I think it is unnecessary to call methods like this, but if we remove the trailling comas, we can make code compatible with PHP 7.1 and PHP 7.2.
OFFTOPIC: Can you add the "hacktoberfest-accepted" label to this pull request? Beacuse I found your project because of Hacktoberfest and I would like to participate in the Hacktoberfest with this pull request. :)
Closes #67
Hi @kukko Does this fix the problem though originally raised in #67 ?
I don't see any tests for this behaviour?
$a = Period::make('2018-01-01 06:30:00', '2018-01-01 07:30:00');
$b = Period::make('2018-01-01 09:00:00', '2018-01-01 10:00:00');
$overlap = $a->touchesWith($b);
(true)
Excuse me, I didn't created those tests, but now I made them.
Going to close this one, as there's already a PR that I'm going to merge to fix this issue: https://github.com/spatie/period/pull/68
Make
touchesWith
to work properly. Previously if the difference between the end and start of the two periods was one day or fewer, it returned true. Now it checks that the two period touches based on difference in seconds.I had to change some already existing tests, because the tests also relied on that the difference between the periods was one day or fewer.