57 Commits
Author SHA1 Message Date
Jérôme Gamez 9818902960 Release 3.1.0 2026-08-22 23:09:57 +02:00
Jérôme Gamez 622d86328b Deprecate Clock interface 2026-08-22 00:11:17 +02:00
Jérôme Gamez bebff7fd27 Test against PHP 8.6 2026-08-21 00:00:48 +02:00
Jérôme Gamez 2c5bf134e4 Inherit funding information from the .github repo 2026-05-04 17:56:55 +02:00
github-actions[bot] 8f0a5a5f6c Merge pull request #23 from beste/dependabot/github_actions/dependabot/fetch-metadata-3.1.0
github-actions(deps): bump dependabot/fetch-metadata from 3.0.0 to 3.1.0
2026-04-20 20:38:22 +00:00
dependabot[bot] e7b50902b0 github-actions(deps): bump dependabot/fetch-metadata from 3.0.0 to 3.1.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-version: 3.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-04-20 20:38:10 +00:00
Jérôme Gamez 264e712f65 Fix dependencies label 2026-03-29 00:43:27 +01:00
github-actions[bot] ebe8de302d Merge pull request #22 from beste/dependabot/github_actions/dependabot/fetch-metadata-3.0.0
github-actions(deps): bump dependabot/fetch-metadata from 2.5.0 to 3.0.0
2026-03-27 18:22:50 +00:00
dependabot[bot] 4bd164d047 github-actions(deps): bump dependabot/fetch-metadata from 2.5.0 to 3.0.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.5.0 to 3.0.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.5.0...v3.0.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-03-27 18:22:38 +00:00
github-actions[bot] 5ae0cc3a8d Merge pull request #21 from beste/dependabot/github_actions/ramsey/composer-install-4
github-actions(deps): bump ramsey/composer-install from 3 to 4
2026-03-16 18:55:39 +00:00
dependabot[bot] 0611b8339d github-actions(deps): bump ramsey/composer-install from 3 to 4
Bumps [ramsey/composer-install](https://github.com/ramsey/composer-install) from 3 to 4.
- [Release notes](https://github.com/ramsey/composer-install/releases)
- [Commits](https://github.com/ramsey/composer-install/compare/v3...v4)

---
updated-dependencies:
- dependency-name: ramsey/composer-install
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-03-16 18:55:21 +00:00
Jérôme Gamez 729cb30697 Add thanks.dev 2026-02-12 09:28:42 +01:00
github-actions[bot] dc84fbe85a Merge pull request #20 from beste/dependabot/github_actions/dependabot/fetch-metadata-2.5.0
github-actions(deps): bump dependabot/fetch-metadata from 2.4.0 to 2.5.0
2026-01-05 18:39:43 +00:00
dependabot[bot] 93c6f6dca7 github-actions(deps): bump dependabot/fetch-metadata from 2.4.0 to 2.5.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.4.0 to 2.5.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.4.0...v2.5.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-version: 2.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-01-05 18:39:31 +00:00
github-actions[bot] e4b5b09932 Merge pull request #19 from beste/dependabot/github_actions/actions/checkout-6
github-actions(deps): bump actions/checkout from 5 to 6
2025-11-20 18:04:47 +00:00
dependabot[bot] 9c852bc985 github-actions(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-11-20 18:04:36 +00:00
Jérôme Gamez 48c449b37e Import classes instead of using FQNs 2025-09-29 23:57:09 +02:00
Jérôme Gamez ff31026046 Test with PHP 8.5 2025-09-29 23:57:09 +02:00
Jérôme Gamez d623da43da Update PHPStan and fix wrong @covers annotations 2025-09-12 16:04:10 +02:00
github-actions[bot] 5a0bf8fdba Merge pull request #18 from beste/dependabot/github_actions/actions/checkout-5
github-actions(deps): bump actions/checkout from 4 to 5
2025-08-12 22:20:35 +00:00
dependabot[bot] 88ddce2cd7 github-actions(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-08-12 22:20:22 +00:00
github-actions[bot] 26ac2fab9a Merge pull request #17 from beste/dependabot/github_actions/dependabot/fetch-metadata-2.4.0
github-actions(deps): bump dependabot/fetch-metadata from 2.3.0 to 2.4.0
2025-05-12 18:42:40 +00:00
dependabot[bot] 0b23a6d481 github-actions(deps): bump dependabot/fetch-metadata from 2.3.0 to 2.4.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.3.0...v2.4.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-version: 2.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-05-12 18:42:28 +00:00
github-actions[bot] 2e9fb8d220 Merge pull request #16 from beste/dependabot/github_actions/dependabot/fetch-metadata-2.3.0
github-actions(deps): bump dependabot/fetch-metadata from 2.2.0 to 2.3.0
2025-01-27 18:21:32 +00:00
dependabot[bot] 1278a71f80 github-actions(deps): bump dependabot/fetch-metadata from 2.2.0 to 2.3.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-01-27 18:21:03 +00:00
Jérôme Gamez 17e1c4ce7e Remove Psalm 2024-08-17 01:11:54 +02:00
Jérôme Gamez 0d80994228 Test with PHP 8.3 and 8.4 2024-08-17 01:07:13 +02:00
Jérôme Gamez 1a2fab532b Bump dev-dependencies 2024-08-17 00:55:49 +02:00
Jérôme Gamez 84e729ce8c Create FUNDING.yml 2024-07-13 21:45:02 +02:00
Jérôme Gamez 06686333c0 Add security policy 2024-07-13 21:26:56 +02:00
github-actions[bot] 621355dffd Merge pull request #15 from beste/dependabot/github_actions/dependabot/fetch-metadata-2.2.0
github-actions(deps): bump dependabot/fetch-metadata from 2.1.0 to 2.2.0
2024-07-05 18:12:59 +00:00
dependabot[bot] 88afd40a02 github-actions(deps): bump dependabot/fetch-metadata from 2.1.0 to 2.2.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.1.0...v2.2.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-07-05 18:12:48 +00:00
github-actions[bot] ec0d9b2006 Merge pull request #14 from beste/dependabot/github_actions/dependabot/fetch-metadata-2.1.0
github-actions(deps): bump dependabot/fetch-metadata from 2.0.0 to 2.1.0
2024-04-24 18:56:30 +00:00
dependabot[bot] c3758513b5 github-actions(deps): bump dependabot/fetch-metadata from 2.0.0 to 2.1.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-04-24 18:56:15 +00:00
github-actions[bot] 6fcddef411 Merge pull request #13 from beste/dependabot/github_actions/dependabot/fetch-metadata-2.0.0
github-actions(deps): bump dependabot/fetch-metadata from 1.7.0 to 2.0.0
2024-03-22 18:07:23 +00:00
dependabot[bot] b69661437f github-actions(deps): bump dependabot/fetch-metadata from 1.7.0 to 2.0.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.7.0 to 2.0.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.7.0...v2.0.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-03-22 18:07:09 +00:00
github-actions[bot] fc7cb0d32c Merge pull request #12 from beste/dependabot/github_actions/dependabot/fetch-metadata-1.7.0
github-actions(deps): bump dependabot/fetch-metadata from 1.6.0 to 1.7.0
2024-03-21 18:54:35 +00:00
dependabot[bot] 05159b138f github-actions(deps): bump dependabot/fetch-metadata from 1.6.0 to 1.7.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.6.0...v1.7.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-03-21 18:54:23 +00:00
Jérôme Gamez d29ed0d755 Link to the PSR-20 Standard 2024-03-02 00:32:58 +01:00
github-actions[bot] 52bafeb8e3 Merge pull request #11 from beste/dependabot/github_actions/ramsey/composer-install-3
github-actions(deps): bump ramsey/composer-install from 2 to 3
2024-02-29 18:51:24 +00:00
dependabot[bot] e9ceb17d59 github-actions(deps): bump ramsey/composer-install from 2 to 3
Bumps [ramsey/composer-install](https://github.com/ramsey/composer-install) from 2 to 3.
- [Release notes](https://github.com/ramsey/composer-install/releases)
- [Commits](https://github.com/ramsey/composer-install/compare/v2...v3)

---
updated-dependencies:
- dependency-name: ramsey/composer-install
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-02-29 18:51:10 +00:00
github-actions[bot] 3861182e4f Merge pull request #10 from beste/dependabot/github_actions/actions/checkout-4
github-actions(deps): bump actions/checkout from 3 to 4
2023-09-04 18:52:35 +00:00
dependabot[bot] 6d38f044b3 github-actions(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-09-04 18:52:21 +00:00
github-actions[bot] aac77907e3 Merge pull request #9 from beste/dependabot/github_actions/dependabot/fetch-metadata-1.6.0
github-actions(deps): bump dependabot/fetch-metadata from 1.5.1 to 1.6.0
2023-06-27 19:02:02 +00:00
dependabot[bot] ed1c70ffdf github-actions(deps): bump dependabot/fetch-metadata from 1.5.1 to 1.6.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.5.1...v1.6.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-27 19:01:49 +00:00
github-actions[bot] 8ec664cfae Merge pull request #8 from beste/dependabot/github_actions/dependabot/fetch-metadata-1.5.1
github-actions(deps): bump dependabot/fetch-metadata from 1.5.0 to 1.5.1
2023-05-24 19:02:10 +00:00
dependabot[bot] 5af4eaf534 github-actions(deps): bump dependabot/fetch-metadata from 1.5.0 to 1.5.1
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.5.0...v1.5.1)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-05-24 19:01:53 +00:00
github-actions[bot] 4b68b50507 Merge pull request #7 from beste/dependabot/github_actions/dependabot/fetch-metadata-1.5.0
github-actions(deps): bump dependabot/fetch-metadata from 1.4.0 to 1.5.0
2023-05-22 19:06:20 +00:00
dependabot[bot] 0999d2836d github-actions(deps): bump dependabot/fetch-metadata from 1.4.0 to 1.5.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-05-22 19:06:02 +00:00
github-actions[bot] 95e0cb0ec2 Merge pull request #6 from beste/dependabot/github_actions/dependabot/fetch-metadata-1.4.0
github-actions(deps): bump dependabot/fetch-metadata from 1.3.6 to 1.4.0
2023-04-18 18:13:07 +00:00
dependabot[bot] 862f942124 github-actions(deps): bump dependabot/fetch-metadata from 1.3.6 to 1.4.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.6 to 1.4.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.6...v1.4.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-04-18 18:12:52 +00:00
github-actions[bot] fdf9c1bd04 Merge pull request #5 from beste/dependabot/github_actions/dependabot/fetch-metadata-1.3.6
github-actions(deps): bump dependabot/fetch-metadata from 1.3.5 to 1.3.6
2023-01-24 18:09:52 +00:00
dependabot[bot] 1f72d04e67 github-actions(deps): bump dependabot/fetch-metadata from 1.3.5 to 1.3.6
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.5 to 1.3.6.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.5...v1.3.6)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-24 18:09:36 +00:00
Jérôme Gamez 7004b55fcd Release 3.0.0 2022-11-26 19:03:05 +01:00
Jérôme Gamez ebd491dc6e Replace stella-maris/clock with psr/clock 2022-11-26 19:01:32 +01:00
Jérôme Gamez cf2cc16e66 Release 2.3.1 2022-11-25 19:24:28 +01:00
Jérôme Gamez 6ee3f318f8 Switch back to stella-maris/clock
This reverts commit a5e62affe0.
2022-11-25 19:22:56 +01:00
14 changed files with 63 additions and 62 deletions
-1
View File
@@ -6,4 +6,3 @@
/.gitignore export-ignore /.gitignore export-ignore
/phpstan.neon.dist export-ignore /phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore /phpunit.xml.dist export-ignore
/psalm.xml.dist export-ignore
+1 -1
View File
@@ -12,4 +12,4 @@ updates:
prefix: "github-actions" prefix: "github-actions"
open-pull-requests-limit: 10 open-pull-requests-limit: 10
labels: labels:
- "dependency" - "dependencies"
+1 -1
View File
@@ -12,7 +12,7 @@ jobs:
steps: steps:
- name: "Dependabot metadata" - name: "Dependabot metadata"
id: "metadata" id: "metadata"
uses: "dependabot/fetch-metadata@v1.3.5" uses: "dependabot/fetch-metadata@v3.1.0"
with: with:
github-token: "${{ secrets.GITHUB_TOKEN }}" github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Enable auto-merge for Dependabot PRs" - name: "Enable auto-merge for Dependabot PRs"
+12 -6
View File
@@ -6,11 +6,12 @@ on:
branches: branches:
- '1.x' - '1.x'
- '2.x' - '2.x'
- '3.x'
jobs: jobs:
tests: tests:
name: PHP ${{ matrix.php }} name: PHP ${{ matrix.php }}
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
@@ -18,10 +19,16 @@ jobs:
- "8.0" - "8.0"
- "8.1" - "8.1"
- "8.2" - "8.2"
- "8.3"
- "8.4"
- "8.5"
include:
- php: "8.6"
composer-options: "--ignore-platform-req=php+"
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v6
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
@@ -31,7 +38,9 @@ jobs:
env: env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: "ramsey/composer-install@v2" - uses: "ramsey/composer-install@v4"
with:
composer-options: "${{ matrix.composer-options }}"
- name: Setup problem matchers for PHP - name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
@@ -39,9 +48,6 @@ jobs:
- name: Run PHPStan - name: Run PHPStan
run: vendor/bin/phpstan analyse --error-format=github run: vendor/bin/phpstan analyse --error-format=github
- name: Run Psalm
run: vendor/bin/psalm --output-format=github
- name: Setup Problem Matchers for PHPUnit - name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
-1
View File
@@ -4,4 +4,3 @@
/composer.lock /composer.lock
/phpstan.neon /phpstan.neon
/phpunit.xml /phpunit.xml
/psalm.xml
+14
View File
@@ -1,5 +1,19 @@
# CHANGELOG # CHANGELOG
## Unreleased
## 3.1.0 - 2026-08-22
Deprecates `Beste\Clock` in favor of `Psr\Clock\ClockInterface`. The implementations continue to implement
the deprecated interface for backwards compatibility. Please type against `Psr\Clock\ClockInterface`.
`Beste\Clock` will be removed in 4.0.
## 3.0.0 - 2022-11-26
This release replaces `stella-maris/clock` with `psr/clock`.
## 2.3.1 - 2022-11-25
This release reverts the change to implement `psr/clock` directly, to not break dependents who rely on `stella-maris/clock`
## 2.3.0 - 2022-11-25 ## 2.3.0 - 2022-11-25
This release re-introduces support for PHP ^8.0 and implements the freshly released `psr/clock` (PSR-20) directly. This release re-introduces support for PHP ^8.0 and implements the freshly released `psr/clock` (PSR-20) directly.
+1 -1
View File
@@ -4,7 +4,7 @@
[![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/beste/clock)](https://packagist.org/packages/beste/clock) [![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/beste/clock)](https://packagist.org/packages/beste/clock)
[![Tests](https://github.com/beste/clock/actions/workflows/tests.yml/badge.svg)](https://github.com/beste/clock/actions/workflows/tests.yml) [![Tests](https://github.com/beste/clock/actions/workflows/tests.yml/badge.svg)](https://github.com/beste/clock/actions/workflows/tests.yml)
A collection of Clock implementations. A collection of [PSR-20](https://www.php-fig.org/psr/psr-20/) Clock implementations.
## Table of Contents ## Table of Contents
+5
View File
@@ -0,0 +1,5 @@
## Security contact information
To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.
+6 -10
View File
@@ -15,13 +15,11 @@
"psr/clock": "^1.0" "psr/clock": "^1.0"
}, },
"require-dev": { "require-dev": {
"phpstan/extension-installer": "^1.2", "phpstan/extension-installer": "^1.4.1",
"phpstan/phpstan": "^1.9.1", "phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^1.2.2", "phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^1.4.4", "phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^9.5.26", "phpunit/phpunit": "^9.6.20"
"psalm/plugin-phpunit": "^0.16.1",
"vimeo/psalm": "^4.29"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@@ -48,11 +46,9 @@
"scripts": { "scripts": {
"test": [ "test": [
"@phpstan", "@phpstan",
"@psalm",
"@phpunit" "@phpunit"
], ],
"phpunit": "vendor/bin/phpunit", "phpunit": "vendor/bin/phpunit",
"phpstan": "vendor/bin/phpstan analyse", "phpstan": "vendor/bin/phpstan analyse"
"psalm": "vendor/bin/psalm"
} }
} }
-21
View File
@@ -1,21 +0,0 @@
<?xml version="1.0"?>
<psalm
xmlns="https://getpsalm.org/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
cacheDirectory=".build/psalm"
errorLevel="1"
resolveFromConfigFile="true"
>
<projectFiles>
<directory name="src" />
<directory name="tests" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<plugins>
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
</plugins>
</psalm>
+3
View File
@@ -6,6 +6,9 @@ namespace Beste;
use Psr\Clock\ClockInterface; use Psr\Clock\ClockInterface;
/**
* @deprecated since 3.1.0, use {@see ClockInterface} instead.
*/
interface Clock extends ClockInterface interface Clock extends ClockInterface
{ {
+1 -1
View File
@@ -25,7 +25,7 @@ final class WrappingClock implements Clock
} }
if (!method_exists($clock, 'now')) { if (!method_exists($clock, 'now')) {
throw new InvalidArgumentException('$clock must implement '.ClockInterface::class.' or have a now() method'); throw new InvalidArgumentException('$clock must implement StellaMaris\Clock\ClockInterface or have a now() method');
} }
if (!($clock->now() instanceof DateTimeImmutable)) { if (!($clock->now() instanceof DateTimeImmutable)) {
+10 -10
View File
@@ -32,10 +32,10 @@ final class FrozenClockTest extends TestCase
/** /**
* @test * @test
* *
* @uses \Beste\Clock\FrozenClock::__construct * @uses ::__construct
* @uses \Beste\Clock\FrozenClock::fromUTC() * @uses ::fromUTC
* *
* @covers ::now() * @covers ::now
*/ */
public function itReturnsAnEqualNowButNotTheSame(): void public function itReturnsAnEqualNowButNotTheSame(): void
{ {
@@ -51,8 +51,8 @@ final class FrozenClockTest extends TestCase
/** /**
* @test * @test
* *
* @uses \Beste\Clock\FrozenClock::__construct * @uses ::__construct
* @uses \Beste\Clock\FrozenClock::now * @uses ::now
* *
* @covers ::withNowFrom * @covers ::withNowFrom
*/ */
@@ -74,8 +74,8 @@ final class FrozenClockTest extends TestCase
/** /**
* @test * @test
* *
* @uses \Beste\Clock\FrozenClock::__construct * @uses ::__construct
* @uses \Beste\Clock\FrozenClock::now * @uses ::now
* *
* @covers ::fromUTC * @covers ::fromUTC
*/ */
@@ -90,9 +90,9 @@ final class FrozenClockTest extends TestCase
/** /**
* @test * @test
* *
* @uses \Beste\Clock\FrozenClock::__construct * @uses ::__construct
* @uses \Beste\Clock\FrozenClock::at * @uses ::at
* @uses \Beste\Clock\FrozenClock::now * @uses ::now
* *
* @covers ::setTo * @covers ::setTo
*/ */
+9 -9
View File
@@ -6,6 +6,8 @@ namespace Beste\Clock\Tests;
use Beste\Clock\FrozenClock; use Beste\Clock\FrozenClock;
use Beste\Clock\WrappingClock; use Beste\Clock\WrappingClock;
use DateTimeImmutable;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** /**
@@ -18,7 +20,7 @@ final class WrappingClockTest extends TestCase
* @test * @test
* *
* @covers ::__construct * @covers ::__construct
* @covers ::create * @covers ::wrapping
* @covers ::now * @covers ::now
*/ */
public function itWrapsAClockInterface(): void public function itWrapsAClockInterface(): void
@@ -36,23 +38,21 @@ final class WrappingClockTest extends TestCase
/** /**
* @test * @test
* *
* @covers ::__construct * @covers ::wrapping
* @covers ::create
* @covers ::now
*/ */
public function itWrapsAnObjectWithANowMethod(): void public function itWrapsAnObjectWithANowMethod(): void
{ {
$now = FrozenClock::fromUTC()->now(); $now = FrozenClock::fromUTC()->now();
$clock = new class($now) { $clock = new class($now) {
private \DateTimeImmutable $now; private DateTimeImmutable $now;
public function __construct(\DateTimeImmutable $now) public function __construct(DateTimeImmutable $now)
{ {
$this->now = $now; $this->now = $now;
} }
public function now(): \DateTimeImmutable public function now(): DateTimeImmutable
{ {
return $this->now; return $this->now;
} }
@@ -69,7 +69,7 @@ final class WrappingClockTest extends TestCase
/** /**
* @test * @test
* *
* @covers ::create * @covers ::wrapping
*/ */
public function itRejectsObjectsWithANowMethodReturningANonDateTimeImmutable(): void public function itRejectsObjectsWithANowMethodReturningANonDateTimeImmutable(): void
{ {
@@ -80,7 +80,7 @@ final class WrappingClockTest extends TestCase
} }
}; };
$this->expectException(\InvalidArgumentException::class); $this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('$clock->now() must return a DateTimeImmutable'); $this->expectExceptionMessage('$clock->now() must return a DateTimeImmutable');
WrappingClock::wrapping($clock); WrappingClock::wrapping($clock);