Skip to content

Kirby 3.6.6

$file->validateContents()

Validates the file contents depending on the file type

$file->validateContents(string|bool $typeLazy = false): void

Parameters

Name Type Default Description
$typeLazy string|bool false Explicit sane handler type string,
true for lazy autodetection or
false for normal autodetection

Exceptions

Type Description
Kirby\Exception\InvalidArgumentException If the file didn't pass validation
Kirby\Exception\NotFoundException If the handler was not found
Kirby\Exception\Exception On other errors

Parent class

Kirby\Filesystem\File