File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -128,9 +128,9 @@ public function toDateTime(mixed $value): Carbon|int|false
128128 protected function convertLdapTimeToDateTime (string $ value ): DateTime |false
129129 {
130130 return DateTime::createFromFormat (match (true ) {
131- str_contains ($ value , '. 000Z ' ) => 'YmdHis.000\Z ' ,
132- str_contains ($ value , '. 0Z ' ) => 'YmdHis.0\Z ' ,
133- str_contains ($ value , 'Z ' ) => 'YmdHis\Z ' ,
131+ str_ends_with ($ value , '000Z ' ) => 'YmdHis.000\Z ' ,
132+ str_ends_with ($ value , '0Z ' ) => 'YmdHis.0\Z ' ,
133+ str_ends_with ($ value , 'Z ' ) => 'YmdHis\Z ' ,
134134 default => 'YmdHisT ' ,
135135 }, $ value );
136136 }
@@ -153,7 +153,7 @@ protected function convertDateTimeToLdapTime(DateTime $date): string
153153 protected function convertWindowsTimeToDateTime (string $ value ): DateTime |false
154154 {
155155 return DateTime::createFromFormat (match (true ) {
156- str_contains ($ value , '. 0Z ' ) => 'YmdHis.0\Z ' ,
156+ str_ends_with ($ value , '0Z ' ) => 'YmdHis.0\Z ' ,
157157 default => 'YmdHis.0T '
158158 }, $ value , new DateTimeZone ('UTC ' ));
159159 }
You can’t perform that action at this time.
0 commit comments