✨ New Features
- Native MongoDB support - New
asMongoUTC()method directly returns MongoDB's nativeUTCDateTimeobjects - Namespace reorganization - Core interfaces moved to
Recruiter\Clocknamespace for better organization
🛠️ Improvements
- Direct MongoDB integration - Added
MongoUTCClockinterface andPsrMongoUTCClockwrapper for seamless MongoDBBSON\UTCDateTimeconversion - Better namespace structure - Relocated core interfaces (
Clock,UTCClock,MicrotimeClock,StopWatch) to dedicated namespaces
🔧 API Changes
New MongoDB Clock Access
All clock implementations now provide direct MongoDB UTCDateTime conversion:
use Recruiter\Clock\SystemClock;
$clock = new SystemClock();
// NEW: Direct MongoDB UTCDateTime conversion
$mongoUTC = $clock->asMongoUTC(); // Returns MongoUTCClock
$bsonDateTime = $mongoUTC->now(); // Returns MongoDB\BSON\UTCDateTime
// Existing specialized clocks still available
$utcClock = $clock->asUTC(); // Custom UTCDateTime for advanced operations
$microtimeClock = $clock->asMicrotime(); // Float timestamp operationsThis addition complements the existing asUTC() method, providing native MongoDB types when needed while keeping the powerful custom UTCDateTime class for advanced operations.
📦 Dependencies
No dependency changes - continues to use symfony/clock: ^7.3