diff --git a/src/File.php b/src/File.php index 03fca21b..53583b8f 100644 --- a/src/File.php +++ b/src/File.php @@ -1174,13 +1174,10 @@ public function getAbsoluteSize() return $this->File->getAbsoluteSize(); } - /** - * @return ValidationResult - */ - public function validate() + public function validate(): ValidationResult { $result = ValidationResult::create(); - $this->File->validate($result, $this->Name); + $this->File->validateFilename($result, $this->Name); $this->extend('updateValidate', $result); return $result; } diff --git a/src/Folder.php b/src/Folder.php index 1ccf8364..ab79f075 100644 --- a/src/Folder.php +++ b/src/Folder.php @@ -336,7 +336,7 @@ public function StripThumbnail() return null; } - public function validate() + public function validate(): ValidationResult { $result = ValidationResult::create(); $this->extend('updateValidate', $result); diff --git a/src/Storage/DBFile.php b/src/Storage/DBFile.php index 26d758a4..335c8bf1 100644 --- a/src/Storage/DBFile.php +++ b/src/Storage/DBFile.php @@ -454,7 +454,7 @@ protected function isValidFilename(string $filename): bool protected function assertFilenameValid(string $filename): void { $result = new ValidationResult(); - $this->validate($result, $filename); + $this->validateFilename($result, $filename); if (!$result->isValid()) { throw new ValidationException($result); } @@ -466,7 +466,7 @@ protected function assertFilenameValid(string $filename): void * * @param null|string $filename Optional filename to validate. If omitted, the current value is validated. */ - public function validate(ValidationResult $result, ?string $filename = null): bool + public function validateFilename(ValidationResult $result, ?string $filename = null): bool { if (empty($filename)) { $filename = $this->getFilename();