odan / odan/odan.github.io

2023/11/16/clock-psr20-datetime

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
SCSS
Stars
1
Forks
3
PR merge metrics
No merged PRs in 30d

Description

PHP - Using the PSR-20 Clock | Daniel Opitz - Blog

Handling time can be a tricky task, especially when it comes to testing and ensuring predictable results. PHP provides various functions like time(), microtime() and the \DateTimeImmutable class to fetch the current time, but the problem is when \DateTimeImmutable is hard-coded into logic, unit tests will not be reliable. This is where the ClockInterface comes into play.

https://odan.github.io/2023/11/16/clock-psr20-datetime.html

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the issue title, body, and linked article at odan.github.io/2023/11/16/clock-psr20-datetime.html. The issue does not name a file, test, or specific change, so confirm the intended content update and its completion criteria before beginning.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
content
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.