/** * @param string $unit * @param int $usagePerUnit * @param int $authenticatedUsagePerUnit * * @throws \InvalidArgumentException * @return void */ public static function setLimit($unit, $usagePerUnit, $authenticatedUsagePerUnit = null) { static::validate($unit); static::$unit = $unit; static::$usagePerUnit = $usagePerUnit; static::$authenticatedUsagePerUnit = $authenticatedUsagePerUnit ?: $usagePerUnit; }
/** * @param string $unit * @param int $usagePerUnit * @param int $authenticatedUsagePerUnit set it to false to give unlimited access * * @throws \InvalidArgumentException * @return void */ public static function setLimit($unit, $usagePerUnit, $authenticatedUsagePerUnit = null) { static::$unit = $unit; static::$usagePerUnit = $usagePerUnit; static::$authenticatedUsagePerUnit = is_null($authenticatedUsagePerUnit) ? $usagePerUnit : $authenticatedUsagePerUnit; }