primo commit
This commit is contained in:
		
							
								
								
									
										29
									
								
								libraries/vendor/lcobucci/clock/src/FrozenClock.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								libraries/vendor/lcobucci/clock/src/FrozenClock.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,29 @@
 | 
			
		||||
<?php
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace Lcobucci\Clock;
 | 
			
		||||
 | 
			
		||||
use DateTimeImmutable;
 | 
			
		||||
use DateTimeZone;
 | 
			
		||||
 | 
			
		||||
final class FrozenClock implements Clock
 | 
			
		||||
{
 | 
			
		||||
    public function __construct(private DateTimeImmutable $now)
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static function fromUTC(): self
 | 
			
		||||
    {
 | 
			
		||||
        return new self(new DateTimeImmutable('now', new DateTimeZone('UTC')));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setTo(DateTimeImmutable $now): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->now = $now;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function now(): DateTimeImmutable
 | 
			
		||||
    {
 | 
			
		||||
        return $this->now;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user