# Engine::rule_max_times()

How many times a rule may be earned per period (0 = unlimited).

Rules store `max_times`. Rules saved before that field existed only have `max_points` (a cap on total points
per period). It is converted to the number of awards it allowed. A cap smaller than one award can never have
meant points, so it is read as the number of times (10 points with a cap of 5 means five times).

```php
rule_max_times( array $rule, int $per_event ): int
```

## Parameters

- `$rule` (array<string,mixed>) Stored rule row.
- `$per_event` (int) Points per event for the rule.

## Return

`int` 

## Changelog

| Version | Description |
| --- | --- |
| 1.1.0 | Introduced |
