Refactor date handling using tick() helper in Auth and Model - #55
Open
fadrian06 wants to merge 1 commit into
Open
Refactor date handling using tick() helper in Auth and Model#55fadrian06 wants to merge 1 commit into
fadrian06 wants to merge 1 commit into
Conversation
Replace (new Date())->tick() with the tick() helper function to simplify date handling and reduce boilerplate code. This also allows for the removal of unused Leaf\Date imports across the Auth, Model, and User classes.
Contributor
There was a problem hiding this comment.
馃煝 Approval recommended
No unresolved review issues were identified.
Pull request overview
Refactors authentication timestamp generation to use the shared tick() helper and removes obsolete Date imports.
Changes:
- Replaced direct
Dateinstantiation withtick(). - Cleaned up unused imports.
File summaries
| File | Description |
|---|---|
src/Auth/User.php |
Uses tick() for user updates and removes the unused import. |
src/Auth/Model.php |
Uses tick() for model timestamps and removes the unused import. |
src/Auth.php |
Uses tick() for registration and update timestamps. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (pls check at least one)
Description
This pull request refactors how timestamps are generated throughout the authentication system by replacing direct instantiation of the
Dateclass with a globaltick()function. Additionally, unused imports of theDateclass are removed from relevant files. These changes simplify the codebase and ensure a consistent approach to timestamp handling.Timestamp handling refactor:
(new Date())->tick()->format(Config::get('timestamps.format'))withtick()->format(Config::get('timestamps.format'))for generating timestamps in theregister,update, andcreateUserFormethods insrc/Auth.php. [1] [2] [3]createandupdatemethods insrc/Auth/Model.phpto use thetick()function for timestamp formatting. [1] [2]updatemethod insrc/Auth/User.phpto use thetick()function for updating timestamps.Code cleanup:
Dateclass fromsrc/Auth/Model.phpandsrc/Auth/User.php. [1] [2]Does this PR introduce a breaking change? (check one)