protectedfunctiongetOffset($time, $timezone){ // Date-only fields do not have a time zone or offset from UTC associated
// with them. For relative (i.e. 'offset') comparisons, we need to compute
// the user's offset from UTC for use in the query.
$origin_offset = 0; if($this->dateFormat === DateTimeItemInterface::DATE_STORAGE_FORMAT && $this->value['type'] === 'offset'){ $origin_offset = $origin_offset + timezone_offset_get(new \DateTimeZone(date_default_timezone_get()), new \DateTime($time, new \DateTimeZone($timezone))); }
// if a token was regenerated less than a minute ago, there is no need to regenerate it
// if multiple concurrent requests reauthenticate a user we do not want to update the token several times
if($persistentToken->getLastUsed()->getTimestamp() + 60 >= time()){ return; }
/**
* Data provider for ::testMinimumSupportedPhp().
*
* See the parameter documentation of testMinimumSupportedPhp() for the test
* array structure. The last element is the expected minimum supported PHP.
*
* @return \Generator
* Test scenarios.
*/
publicstaticfunctiongetMinimumSupportedPhp(?\DateTime $date = NULL): string { // By default, use the current date (right now).
$date = $date ?? new \DateTime('now');
// In case no data are available or all known PHP versions in this class
// are already end-of-life, default to the version that had the most recent
// end-of-life (the key of the last element in the sorted array).
// The string cast ensures the value is a string, even if the PHP EOL date
// array is empty. As of PHP 8.1, version_compare() no longer accepts NULL
// as a parameter; empty string must be used instead.
$lowest_supported_version = $lowest_supported_version ?? (string)array_key_last(static::$phpEolDates);
// Next, look at versions that are end-of-life after the current date.
// Find the lowest PHP version that is still supported.