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

Dev: replace time() with Time #6815

Closed
kenjis opened this issue Nov 4, 2022 · 7 comments
Closed

Dev: replace time() with Time #6815

kenjis opened this issue Nov 4, 2022 · 7 comments
Labels
dev help wanted More help is needed for the proper resolution of an issue or pull request

Comments

@kenjis
Copy link
Member

kenjis commented Nov 4, 2022

Replace time() with Time class.
time() is not testable.

time()
// ↓
Time::now()->getTimestamp()

See #6753 (review)

$ grep -lr 'time()' system
system/Database/MigrationRunner.php
system/Cache/Handlers/FileHandler.php
system/Cache/Handlers/PredisHandler.php
system/Cache/Handlers/WincacheHandler.php
system/Cache/Handlers/MemcachedHandler.php
system/Cache/Handlers/RedisHandler.php
system/Throttle/Throttler.php
system/Test/Fabricator.php
system/Test/TestResponse.php
system/Test/Mock/MockSession.php
system/Test/Mock/MockCache.php
system/Security/Security.php
system/Images/Handlers/ImageMagickHandler.php
system/HTTP/ResponseTrait.php
system/Files/File.php
system/Cookie/Cookie.php
system/Helpers/date_helper.php
system/ThirdParty/Kint/Parser/MicrotimePlugin.php
system/Email/Email.php
system/Debug/Toolbar/Collectors/Database.php
system/Debug/Toolbar.php
system/BaseModel.php
system/Session/Session.php
system/Session/Handlers/FileHandler.php
system/Session/Handlers/MemcachedHandler.php
system/Session/Handlers/RedisHandler.php
@ddevsr
Copy link
Collaborator

ddevsr commented Nov 17, 2022

Updated :

$ grep -lr 'time()' system
system/Cache/Handlers/FileHandler.php
system/Database/MigrationRunner.php
system/Test/Fabricator.php
system/Test/Mock/MockCache.php
system/Test/Mock/MockSession.php
system/Test/TestResponse.php
system/ThirdParty/Kint/Parser/MicrotimePlugin.php

@kenjis
Copy link
Member Author

kenjis commented Nov 17, 2022

system/ThirdParty/Kint/Parser/MicrotimePlugin.php is not our code.
We don't edit it.

@ping-yee
Copy link
Contributor

Does anyone can approve the last PR #6880 ?
If this PR get merged, this issue will be solved.

@kenjis
Copy link
Member Author

kenjis commented Dec 5, 2022

$ grep -lr 'time()' system
system/Cache/Handlers/PredisHandler.php
system/Throttle/Throttler.php
system/ThirdParty/Kint/Parser/MicrotimePlugin.php
system/Debug/Toolbar.php

@ddevsr
Copy link
Collaborator

ddevsr commented Dec 5, 2022

Now completed changed

@ddevsr ddevsr closed this as completed Dec 5, 2022
@mackxpall

This comment was marked as spam.

@kenjis kenjis reopened this Dec 6, 2022
@kenjis kenjis closed this as completed Dec 6, 2022
@kenjis
Copy link
Member Author

kenjis commented Dec 6, 2022

Thank you! @ping-yee @ddevsr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev help wanted More help is needed for the proper resolution of an issue or pull request
Projects
None yet
Development

No branches or pull requests

4 participants