Skip to content

Commit 86fb5d4

Browse files
committed
Add FrozenClock and SystemClock implementations with service provider integration
- Introduced `FrozenClock` for deterministic time in tests, supporting various input formats. - Implemented `SystemClock` for current system time with optional timezone support. - Created `ClockServiceProvider` to register clock services in the Fast Forward Container. - Added `DateTimeZoneFactory` for creating timezone instances based on configuration. - Developed usage examples demonstrating clock functionalities. - Wrote comprehensive tests for `FrozenClock`, `SystemClock`, and service provider functionalities. - Updated documentation to include usage instructions and examples. Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
0 parents  commit 86fb5d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2613
-0
lines changed

.docheader

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* This file is part of php-fast-forward/clock.
3+
*
4+
* This source file is subject to the license bundled
5+
* with this source code in the file LICENSE.
6+
*
7+
* @copyright Copyright (c) 2025-%year% Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
8+
* @license https://opensource.org/licenses/MIT MIT License
9+
*
10+
* @see https://github.com/php-fast-forward/clock
11+
* @see https://github.com/php-fast-forward
12+
* @see https://datatracker.ietf.org/doc/html/rfc2119
13+
*/

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
* text=auto
2+
/.github/ export-ignore
3+
/docs/ export-ignore
4+
/tests/ export-ignore
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.gitmodules export-ignore

.github/dependabot.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "composer"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "Composer"
9+
include: "scope"
10+
labels:
11+
- "composer"
12+
- "dependencies"
13+
14+
- package-ecosystem: "github-actions"
15+
directory: "/"
16+
schedule:
17+
interval: "weekly"
18+
commit-message:
19+
prefix: "GitHub Actions"
20+
include: "scope"
21+
labels:
22+
- "github-actions"
23+
- "continuous-integration"

.github/wiki

Submodule wiki added at fdf1d06

.github/workflows/reports.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Fast Forward Reports"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pages: write
12+
id-token: write
13+
14+
jobs:
15+
reports:
16+
uses: php-fast-forward/dev-tools/.github/workflows/reports.yml@main
17+
secrets: inherit

.github/workflows/tests.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Fast Forward Test Suite"
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
pages: write
10+
id-token: write
11+
12+
jobs:
13+
tests:
14+
uses: php-fast-forward/dev-tools/.github/workflows/tests.yml@main
15+
secrets: inherit

.github/workflows/wiki.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Fast Forward Wiki Update"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pages: write
12+
id-token: write
13+
14+
jobs:
15+
wiki:
16+
uses: php-fast-forward/dev-tools/.github/workflows/wiki.yml@main
17+
secrets: inherit

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.idea/
2+
.vscode/
3+
backup/
4+
public/
5+
tmp/
6+
vendor/
7+
.DS_Store
8+
composer.lock
9+
*.cache

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule ".github/wiki"]
2+
path = .github/wiki
3+
url = git@github.com:php-fast-forward/clock.wiki.git

0 commit comments

Comments
 (0)