Commit 328e14e 1 parent ea6869e commit 328e14e Copy full SHA for 328e14e
File tree 2 files changed +5
-11
lines changed
2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change 38
38
"contributte/monolog" : " ^0.5" ,
39
39
"cweagans/composer-patches" : " ^1.7" ,
40
40
"doctrine/orm" : " 2.15.*" ,
41
- "fastybird/datetime-factory" : " ^0.6 " ,
41
+ "fastybird/datetime-factory" : " ^0.7.1 " ,
42
42
"fastybird/metadata-library" : " dev-main" ,
43
43
"fastybird/simple-auth" : " ^0.14" ,
44
44
"ipub/doctrine-timestampable" : " ^2.0" ,
47
47
"nette/di" : " ^3.0" ,
48
48
"nette/utils" : " ^4.0" ,
49
49
"orisai/nette-object-mapper" : " ^0.1" ,
50
+ "orisai/object-mapper" : " ^0.2" ,
50
51
"react/event-loop" : " ^1.3" ,
51
52
"sentry/sdk" : " ^3.1" ,
52
53
"symfony/monolog-bridge" : " ^6.1" ,
Original file line number Diff line number Diff line change 18
18
use DateTimeInterface ;
19
19
use FastyBird \DateTimeFactory ;
20
20
use IPub \DoctrineTimestampable \Providers as DoctrineTimestampableProviders ;
21
- use Nette \DI ;
22
21
23
22
/**
24
23
* Date provider for doctrine timestampable
31
30
readonly class DateTimeProvider implements DoctrineTimestampableProviders \DateProvider
32
31
{
33
32
34
- public function __construct (private DI \ Container $ container )
33
+ public function __construct (private DateTimeFactory \ Clock $ clock )
35
34
{
36
35
}
37
36
38
- /**
39
- * @throws DI\MissingServiceException
40
- */
41
37
public function getDate (): DateTimeInterface
42
38
{
43
- return $ this ->container -> getByType ( DateTimeFactory \Factory::class) ->getNow ();
39
+ return $ this ->clock ->getNow ();
44
40
}
45
41
46
- /**
47
- * @throws DI\MissingServiceException
48
- */
49
42
public function getTimestamp (): int
50
43
{
51
- return $ this ->container -> getByType ( DateTimeFactory \Factory::class) ->getNow ()->getTimestamp ();
44
+ return $ this ->clock ->getNow ()->getTimestamp ();
52
45
}
53
46
54
47
}
You can’t perform that action at this time.
0 commit comments