class VideoAnnotationGaps implements ValidationRule

Properties

protected array $frames

Key frame times of the annotation, one for each entry of the points array. May contain null values to represent gaps in the annotation.

Methods

__construct(array $frames)

Create a new instance.

void
validate(string $attribute, mixed $value, Closure $fail)

Run the validation rule.

string|null
getErrorMessage(array $points)

Get the validation error message for a points array.

Details

at line 21
__construct(array $frames)

Create a new instance.

Parameters

array $frames

Key frame times of the annotation.

at line 29
void validate(string $attribute, mixed $value, Closure $fail)

Run the validation rule.

Parameters

string $attribute
mixed $value
Closure $fail

Return Value

void

at line 54
string|null getErrorMessage(array $points)

Get the validation error message for a points array.

This can be used to apply the rule outside of a validator.

The points must already be validated with VideoAnnotationPoints and the frames with VideoAnnotationFrames because this expects a well-formed array of arrays.

Parameters

array $points

Points array like [[x1, y1, ...], [], [x1, y1, ...]] with one entry for each key frame. An empty entry represents a gap.

Return Value

string|null

The error message or null if the gaps are consistent.