kylekatarnls / business-time

Carbon mixin to handle business days and opening hours
MIT License
296 stars 14 forks source link

Make first parameter optional for Schedule method calls #69

Closed kylekatarnls closed 5 months ago

kylekatarnls commented 5 months ago

Allow to call methods such as isOpenOn or isClosedOn without specifying a reference date as first parameter:

$schedule = Schedule::create([...]);

if ($schedule->isOpenOn('Saturday')) {
    // Is typically open on Saturday
}

While it's made available generally by using CarbonImmutable::now() as default reference, it's recommended to use it only for method where the now reference moment is irrelevant. So basically at the moment only isOpenOn and isClosedOn are relevant use cases.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (32212bb) to head (4468091).

:exclamation: Current head 4468091 differs from pull request most recent head 45c0e0b. Consider uploading reports for the commit 45c0e0b to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #69 +/- ## =========================================== Coverage 100.00% 100.00% - Complexity 257 262 +5 =========================================== Files 19 19 Lines 720 730 +10 =========================================== + Hits 720 730 +10 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codeclimate[bot] commented 5 months ago

Code Climate has analyzed commit 45c0e0b4 and detected 4 issues on this pull request.

Here's the issue category breakdown:

Category Count
Style 3
Clarity 1

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 100.0% (0.0% change).

View more on Code Climate.