ENH Add generic types

This commit is contained in:
Guy Sartorelli 2024-01-12 10:39:17 +13:00
parent 4bcdf97157
commit cf944ff91c
No known key found for this signature in database
GPG Key ID: F313E3B9504D496A
2 changed files with 2 additions and 2 deletions

View File

@ -14,6 +14,8 @@ use SilverStripe\TextExtraction\Extractor\FileTextExtractor;
* Adds an additional property which is the cached contents, which is populated on demand.
*
* @author mstephens
*
* @extends DataExtension<File>
*/
class FileTextExtractable extends DataExtension
{
@ -85,7 +87,6 @@ class FileTextExtractable extends DataExtension
*/
public function extractFileAsText($disableCache = false)
{
/** @var File $file */
$file = $this->owner;
if (!$disableCache) {
$text = $this->getTextCache()->load($file);

View File

@ -87,7 +87,6 @@ abstract class FileTextExtractor
// Ensure we have a File instance to work with
if (is_string($file)) {
/** @var File $fileObject */
$fileObject = File::create();
$fileObject->setFromLocalFile($file);
$file = $fileObject;