Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Add singular syntactic sugar to wormhole #38815

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

dwightwatson
Copy link
Contributor

This adds syntactic sugar to the Wormhole for when using singular values. I've found that a number of my tests only go back or forward 1 unit of time and so this reads better.

// Before
$this->travel(1)->weeks();
$this->travel(-1)->weeks();

// After
$this->travel(1)->week();
$this->travel(-1)->week();

Each existing unit gets a singular alias that defers back to the original.

I've copied the docblocks as-is - if I updated them to say "Travel forward a single millisecond" it wouldn't be technically correct. But happy to amend as you see fit.

@taylorotwell taylorotwell merged commit 913c2a1 into laravel:8.x Sep 15, 2021
victorvilella pushed a commit to cdsistemas/framework that referenced this pull request Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants