From fddf1b1c2397249c9041bd9fb8de713826f17ce8 Mon Sep 17 00:00:00 2001 From: Andreas Heigl Date: Sun, 17 Apr 2022 11:31:07 +0200 Subject: [PATCH 1/3] 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. --- composer.json | 3 ++- src/Clock.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 366676b5..cea12ac9 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,8 @@ } ], "require": { - "php": "^8.0" + "php": "^8.0", + "stella-maris/clock": "^0.1" }, "require-dev": { "infection/infection": "^0.26", diff --git a/src/Clock.php b/src/Clock.php index f356776e..529a3c36 100644 --- a/src/Clock.php +++ b/src/Clock.php @@ -4,8 +4,9 @@ namespace Lcobucci\Clock; use DateTimeImmutable; +use StellaMaris\Clock\ClockInterface; -interface Clock +interface Clock extends ClockInterface { public function now(): DateTimeImmutable; } From 4a7ed930cde64632bdf54c766b700f65b293fac5 Mon Sep 17 00:00:00 2001 From: Andreas Heigl Date: Sun, 17 Apr 2022 15:54:36 +0200 Subject: [PATCH 2/3] Update minimum version of clock interface --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cea12ac9..f34dbfd6 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "php": "^8.0", - "stella-maris/clock": "^0.1" + "stella-maris/clock": "^0.1.4" }, "require-dev": { "infection/infection": "^0.26", From 6094408f46f6c5fee3105ecb4be0bc70b22907c3 Mon Sep 17 00:00:00 2001 From: Andreas Heigl Date: Mon, 18 Apr 2022 17:24:58 +0200 Subject: [PATCH 3/3] Add stella-maris/clock to composer.lock This should allow the tests depending on the locked versions to execute the right code --- composer.lock | 52 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/composer.lock b/composer.lock index 3095aeb0..825be775 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,56 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6aa2eb0a0ac8287ee0069d7bd7051654", - "packages": [], + "content-hash": "af17ecc7a44ca3cbe4c0e08e7842b997", + "packages": [ + { + "name": "stella-maris/clock", + "version": "0.1.4", + "source": { + "type": "git", + "url": "https://gitlab.com/stella-maris/clock.git", + "reference": "8a0a967896df4c63417385dc69328a0aec84d9cf" + }, + "dist": { + "type": "zip", + "url": "https://gitlab.com/api/v4/projects/stella-maris%2Fclock/repository/archive.zip?sha=8a0a967896df4c63417385dc69328a0aec84d9cf", + "reference": "8a0a967896df4c63417385dc69328a0aec84d9cf", + "shasum": "" + }, + "require": { + "php": "^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "StellaMaris\\Clock\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Heigl", + "role": "Maintainer" + } + ], + "description": "A pre-release of the proposed PSR-20 Clock-Interface", + "homepage": "https://gitlab.com/stella-maris/clock", + "keywords": [ + "clock", + "datetime", + "point in time", + "psr20" + ], + "support": { + "issues": "https://gitlab.com/stella-maris/clock/-/issues", + "source": "https://gitlab.com/stella-maris/clock/-/tree/0.1.4" + }, + "time": "2022-04-17T14:12:26+00:00" + } + ], "packages-dev": [ { "name": "composer/pcre",