Author SHA1 Message Date
dependabot[bot] aa4266b61f github-actions(deps): bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [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/v6...v7)

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

Signed-off-by: dependabot[bot] <[email protected]>
2026-06-18 18:22:28 +00: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
Jérôme Gamez 2ba952cc73 Release 2.3.0 2022-11-25 19:02:11 +01:00
Jérôme Gamez 2861280adc Re-introduce support for PHP ^8.0 (instead of only 8.1.x and 8.2.x) 2022-11-25 19:02:11 +01:00
Jérôme Gamez a5e62affe0 Switch to the now released psr/clock-interface 2022-11-25 18:08:55 +01:00
github-actions[bot] 5acec1192d Merge pull request #4 from beste/dependabot/github_actions/ramsey/composer-install-2
github-actions(deps): bump ramsey/composer-install from 1 to 2
2022-11-17 18:20:41 +00:00
dependabot[bot] fd2e55f899 github-actions(deps): bump ramsey/composer-install from 1 to 2
Bumps [ramsey/composer-install](https://github.com/ramsey/composer-install) from 1 to 2.
- [Release notes](https://github.com/ramsey/composer-install/releases)
- [Commits](https://github.com/ramsey/composer-install/compare/v1...v2)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-11-17 18:20:16 +00:00
Jérôme Gamez 24b2fc5716 Release 2.2.0 2022-11-05 00:08:15 +01:00
github-actions[bot] 04017e5bc2 Merge pull request #3 from beste/dependabot/github_actions/actions/checkout-3
github-actions(deps): bump actions/checkout from 2 to 3
2022-11-04 23:05:44 +00:00
dependabot[bot] b47e76adf3 github-actions(deps): bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [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/v2...v3)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-11-04 23:05:32 +00:00
Jérôme Gamez 4b16082f08 Set up Dependabot with auto-merge 2022-11-05 00:05:05 +01:00
Jérôme Gamez 317ed729ce Drop support for PHP <8.1 2022-11-05 00:03:47 +01:00
Jérôme Gamez 201ed087ca Re-enable tests for the 1.x and 2.x branches 2022-04-24 15:39:46 +02:00
Jérôme Gamez f3edef9cbc Add a WrappingClock
The `WrappingClock` allows using an object with a `now()` method
returning a `DateTimeImmutable` object as a "real" clock.
2022-04-24 15:38:25 +02:00
Jérôme Gamez 98d1e6f1d8 Release 2.0.0 2022-04-20 16:28:31 +02:00
Andreas Heigl 731f4c9651 Implement forward compatible Clock-Interface
The stella-maris/clock package provides an interface based on the
currently proposed status of PSR20. Due to the inactivity of the PSR20 working
group this is a way to already provide interoperability while still
maintaining forward compatibility. When the current status of PSR20 will
be released at one point in time the stella-maris/clock package will
extend the PSR20 interface so that this package becomes immeadiately
PSR20 compatible without any further work necessary. In the long run the
stella-maris/clock package will then be marked deprecated so that people
can then use the PSR20 provided implementation.

Should the implementation of PSR20 change between now and a possible
release then this interface will still exist and a possible
implementation will need more code-changes anyhow so this interface will
still provide some way of interoperability.

The implementation of the PSR20 polyfill has been moved to the
stella-maris/clock interface which can be implemented independentyl from
PSR20 and might allow some interoperability before the working group of
the FIG manages to decide upon something.
2022-04-20 16:21:40 +02:00
17 changed files with 313 additions and 83 deletions
-1
View File
@@ -6,4 +6,3 @@
/.gitignore export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml.dist export-ignore
+15
View File
@@ -0,0 +1,15 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
include: "scope"
prefix: "github-actions"
open-pull-requests-limit: 10
labels:
- "dependencies"
+2
View File
@@ -0,0 +1,2 @@
# https://probot.github.io/apps/settings/
_extends: beste/.github
@@ -0,0 +1,23 @@
name: "Dependabot auto-merge"
on: [pull_request_target] # yamllint disable-line rule:truthy
permissions:
contents: "write"
jobs:
dependabot:
runs-on: "ubuntu-latest"
if: "${{ github.actor == 'dependabot[bot]' }}"
steps:
- name: "Dependabot metadata"
id: "metadata"
uses: "dependabot/[email protected]"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Enable auto-merge for Dependabot PRs"
if: "${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}"
run: "gh pr merge --auto --merge \"$PR_URL\""
env:
PR_URL: "${{github.event.pull_request.html_url}}"
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"
+12 -14
View File
@@ -4,26 +4,30 @@ on:
pull_request:
push:
branches:
- 'main'
- '1.x'
- '2.x'
- '3.x'
jobs:
tests:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
php:
- "7.4"
- "8.0"
- "8.1"
dependencies:
- "lowest"
- "highest"
- "8.2"
- "8.3"
- "8.4"
include:
- php: "8.5"
composer-options: "--ignore-platform-reqs"
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
@@ -33,10 +37,7 @@ jobs:
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-options }}"
- uses: "ramsey/composer-install@v4"
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
@@ -44,9 +45,6 @@ jobs:
- name: Run PHPStan
run: vendor/bin/phpstan analyse --error-format=github
- name: Run Psalm
run: vendor/bin/psalm --output-format=github
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
-1
View File
@@ -4,4 +4,3 @@
/composer.lock
/phpstan.neon
/phpunit.xml
/psalm.xml
+19 -3
View File
@@ -1,8 +1,24 @@
# CHANGELOG
## [Unreleased]
## 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
This release re-introduces support for PHP ^8.0 and implements the freshly released `psr/clock` (PSR-20) directly.
## 2.2.0 - 2022-11-04
This release drops support for PHP <8.1.
## 2.1.0 - 2022-04-22
Adds the `WrappingClock` which allows using an object with a `now()` method returning a `DateTimeImmutable` object
as a "real" clock.
## 2.0.0 - 2022-04-20
This release introduces a compatibility layer with the PSR-20 draft, allowing us to already
get some interoperability by depending on a shared interface.
## 1.0.0 - 2021-12-10
Initial Release
[Unreleased]: https://github.com/beste/clock/compare/1.0.0...main
+37 -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)
[![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
@@ -15,6 +15,7 @@ A collection of Clock implementations.
- [`UTCClock`](#utcclock) - The clock that you should™ use
- [`FrozenClock`](#frozenclock) - A clock that stopped moving (perfect for tests)
- [`MinuteClock`](#minuteclock) - Who cares about seconds or even less?
- [`WrappingClock`](#wrappingclock) - Allows wrapping a non-clock with a `now()` method in a clock
- [Running Tests](#running-tests)
## Installation
@@ -136,7 +137,42 @@ printf("For %s, the minute clock still returns %s\n",
$frozenClock->now()->format('H:i:s'),
$clock->now()->format('H:i:s')
);
```
### `WrappingClock`
If you already have an object with a `now()` method returning a `DateTimeImmutable` object, you can wrap it
in a `WrappingClock` to make it a "real" Clock.
as a "real" clock.
```php
# examples/wrapping_clock.php
use Beste\Clock\WrappingClock;
// Create a frozen $now so that we can test the wrapping clock.
$now = new DateTimeImmutable('2012-04-24 12:00:00');
// Create an object that is NOT a clock, but has a now() method returning the frozen $now.
$clock = new class($now) {
private \DateTimeImmutable $now;
public function __construct(\DateTimeImmutable $now)
{
$this->now = $now;
}
public function now(): \DateTimeImmutable
{
return $this->now;
}
};
// We can now wrap the object in a clock.
$wrappedClock = WrappingClock::wrapping($clock);
assert($now->format(DATE_ATOM) === $wrappedClock->now()->format(DATE_ATOM));
```
## Running tests
+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.
+12 -13
View File
@@ -11,23 +11,21 @@
}
],
"require": {
"php": "~7.4.0 || ~8.0.0 || ~8.1.0"
"php": "^8.0",
"psr/clock": "^1.0"
},
"require-dev": {
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^9.5.10",
"psalm/plugin-phpunit": "^0.16.0",
"vimeo/psalm": "^4.15"
"phpstan/extension-installer": "^1.4.1",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^9.6.20"
},
"autoload": {
"psr-4": {
"Beste\\Clock\\": "src/Clock"
},
"files": [
"src/psr-polyfill.php",
"src/Clock.php"
]
},
@@ -40,16 +38,17 @@
"psr/clock-implementation": "1.0"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"phpstan/extension-installer": true
}
},
"scripts": {
"test": [
"@phpstan",
"@psalm",
"@phpunit"
],
"phpunit": "vendor/bin/phpunit",
"phpstan": "vendor/bin/phpstan analyse",
"psalm": "vendor/bin/psalm"
"phpstan": "vendor/bin/phpstan analyse"
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php
require __DIR__.'/../vendor/autoload.php';
use Beste\Clock\WrappingClock;
// Create a frozen $now so that we can test the wrapping clock.
$now = new DateTimeImmutable('2012-04-24 12:00:00');
// Create an object that is NOT a clock, but has a now() method returning the frozen $now.
$clock = new class($now) {
private \DateTimeImmutable $now;
public function __construct(\DateTimeImmutable $now)
{
$this->now = $now;
}
public function now(): \DateTimeImmutable
{
return $this->now;
}
};
// We can now wrap the object in a clock.
$wrappedClock = WrappingClock::wrapping($clock);
assert($now->format(DATE_ATOM) === $wrappedClock->now()->format(DATE_ATOM));
-2
View File
@@ -7,5 +7,3 @@ parameters:
tmpDir: .build/phpstan/
bootstrapFiles:
- ./src/psr-polyfill.php
-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>
+62
View File
@@ -0,0 +1,62 @@
<?php
declare(strict_types=1);
namespace Beste\Clock;
use Beste\Clock;
use DateTimeImmutable;
use InvalidArgumentException;
use Psr\Clock\ClockInterface;
final class WrappingClock implements Clock
{
private ClockInterface $wrappedClock;
private function __construct(ClockInterface $wrappedClock)
{
$this->wrappedClock = $wrappedClock;
}
public static function wrapping(object $clock): self
{
if ($clock instanceof ClockInterface) {
return new self($clock);
}
if (!method_exists($clock, 'now')) {
throw new InvalidArgumentException('$clock must implement StellaMaris\Clock\ClockInterface or have a now() method');
}
if (!($clock->now() instanceof DateTimeImmutable)) {
throw new InvalidArgumentException('$clock->now() must return a DateTimeImmutable');
}
$wrappedClock = new class($clock) implements ClockInterface {
private object $clock;
public function __construct(object $clock)
{
$this->clock = $clock;
}
public function now(): DateTimeImmutable
{
assert(method_exists($this->clock, 'now'));
$now = $this->clock->now();
assert($now instanceof DateTimeImmutable);
return $now;
}
};
return new self($wrappedClock);
}
public function now(): DateTimeImmutable
{
return $this->wrappedClock->now();
}
}
-17
View File
@@ -1,17 +0,0 @@
<?php
namespace Psr\Clock;
if (class_exists('\Psr\Clock\ClockInterface')) {
return;
}
use DateTimeImmutable;
interface ClockInterface
{
/**
* Returns the current time as a DateTimeImmutable Object
*/
public function now(): DateTimeImmutable;
}
+10 -10
View File
@@ -32,10 +32,10 @@ final class FrozenClockTest extends TestCase
/**
* @test
*
* @uses \Beste\Clock\FrozenClock::__construct
* @uses \Beste\Clock\FrozenClock::fromUTC()
* @uses ::__construct
* @uses ::fromUTC
*
* @covers ::now()
* @covers ::now
*/
public function itReturnsAnEqualNowButNotTheSame(): void
{
@@ -51,8 +51,8 @@ final class FrozenClockTest extends TestCase
/**
* @test
*
* @uses \Beste\Clock\FrozenClock::__construct
* @uses \Beste\Clock\FrozenClock::now
* @uses ::__construct
* @uses ::now
*
* @covers ::withNowFrom
*/
@@ -74,8 +74,8 @@ final class FrozenClockTest extends TestCase
/**
* @test
*
* @uses \Beste\Clock\FrozenClock::__construct
* @uses \Beste\Clock\FrozenClock::now
* @uses ::__construct
* @uses ::now
*
* @covers ::fromUTC
*/
@@ -90,9 +90,9 @@ final class FrozenClockTest extends TestCase
/**
* @test
*
* @uses \Beste\Clock\FrozenClock::__construct
* @uses \Beste\Clock\FrozenClock::at
* @uses \Beste\Clock\FrozenClock::now
* @uses ::__construct
* @uses ::at
* @uses ::now
*
* @covers ::setTo
*/
+88
View File
@@ -0,0 +1,88 @@
<?php
declare(strict_types=1);
namespace Beste\Clock\Tests;
use Beste\Clock\FrozenClock;
use Beste\Clock\WrappingClock;
use DateTimeImmutable;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
/**
* @internal
* @coversDefaultClass \Beste\Clock\WrappingClock
*/
final class WrappingClockTest extends TestCase
{
/**
* @test
*
* @covers ::__construct
* @covers ::wrapping
* @covers ::now
*/
public function itWrapsAClockInterface(): void
{
$clock = FrozenClock::fromUTC();
$wrappedClock = WrappingClock::wrapping($clock);
self::assertSame(
$clock->now()->format(DATE_ATOM),
$wrappedClock->now()->format(DATE_ATOM)
);
}
/**
* @test
*
* @covers ::wrapping
*/
public function itWrapsAnObjectWithANowMethod(): void
{
$now = FrozenClock::fromUTC()->now();
$clock = new class($now) {
private DateTimeImmutable $now;
public function __construct(DateTimeImmutable $now)
{
$this->now = $now;
}
public function now(): DateTimeImmutable
{
return $this->now;
}
};
$wrappedClock = WrappingClock::wrapping($clock);
self::assertSame(
$now->format(DATE_ATOM),
$wrappedClock->now()->format(DATE_ATOM)
);
}
/**
* @test
*
* @covers ::wrapping
*/
public function itRejectsObjectsWithANowMethodReturningANonDateTimeImmutable(): void
{
$clock = new class() {
public function now(): string
{
return 'foo';
}
};
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('$clock->now() must return a DateTimeImmutable');
WrappingClock::wrapping($clock);
}
}