Upgrade to 3.5.4

This commit is contained in:
Bastian Allgeier
2021-04-27 10:41:42 +02:00
parent 011139ef61
commit 7477aec06c
11 changed files with 1069 additions and 10 deletions

View File

@@ -3,6 +3,7 @@
namespace Kirby\Toolkit;
use Exception;
use Kirby\Sane\Sane;
/**
* Flexible File object with a set of helpful
@@ -323,6 +324,23 @@ class File
return F::type($this->root);
}
/**
* Validates the file contents depending on the file type
*
* @param string|bool $typeLazy Explicit sane handler type string,
* `true` for lazy autodetection or
* `false` for normal autodetection
* @return void
*
* @throws \Kirby\Exception\InvalidArgumentException If the file didn't pass validation
* @throws \Kirby\Exception\NotFoundException If the handler was not found
* @throws \Kirby\Exception\Exception On other errors
*/
public function validateContents($typeLazy = false): void
{
Sane::validateFile($this->root(), $typeLazy);
}
/**
* Writes content to the file
*