ENH Add generic types (#86)

This commit is contained in:
Guy Sartorelli 2024-01-23 12:46:57 +13:00 committed by GitHub
parent 4bcdf97157
commit cc43a120c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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;