private static function validateUnit($unit)
{
if (!is_string($unit)) {
throw new \InvalidArgumentException(sprintf('Expected string value for time unit, got "%s"', is_object($unit) ? get_class($unit) : gettype($unit)));
}
if (!isset(self::$map[$unit])) {
throw new \InvalidArgumentException(sprintf('Invalid time unit "%s", available units: "%s"', $unit, implode('", "', array_keys(self::$map))));
}
}