File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 4242 "ext-pcre" : " *" ,
4343 "ext-spl" : " *" ,
4444
45+ "psr/clock" : " ~1.0" ,
4546 "simplesamlphp/assert" : " ~1.9" ,
4647 "simplesamlphp/composer-xmlprovider-installer" : " ~1.2"
4748 },
Original file line number Diff line number Diff line change 66
77use DateTimeImmutable ;
88use DateTimeInterface ;
9+ use Psr \Clock \ClockInterface ;
910use SimpleSAML \XML \Assert \Assert ;
1011use SimpleSAML \XMLSchema \Exception \SchemaViolationException ;
1112use SimpleSAML \XMLSchema \Type \Interface \AbstractAnySimpleType ;
@@ -47,6 +48,15 @@ protected function validateValue(string $value): void
4748 }
4849
4950
51+ /**
52+ * @return static
53+ */
54+ public static function now (ClockInterface $ clock ): static
55+ {
56+ return static ::fromDateTime ($ clock ->now ());
57+ }
58+
59+
5060 /**
5161 * @param \DateTimeInterface $value
5262 * @return static
You can’t perform that action at this time.
0 commit comments