mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
ENH Add generic types (#86)
This commit is contained in:
parent
4bcdf97157
commit
cc43a120c8
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user