12 protected $extensionData;
20 if ( $this->extensionData ) {
21 return call_user_func( $this->extensionData );
35 if ( $extensionData instanceof Closure ) {
36 $this->extensionData = $extensionData;
37 } elseif ( is_array( $extensionData ) ) {
38 wfDeprecated( __METHOD__ .
' with array argument',
'1.32' );
39 $this->extensionData =
static function () use ( $extensionData ) {
40 return $extensionData;
43 $type = get_debug_type( $extensionData );
44 throw new InvalidArgumentException(
45 __METHOD__ .
" must be called with Closure|array, but received $type" );
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
trait SearchResultTrait
Trait for SearchResult subclasses to share non-obvious behaviors or methods that rarely specialized.
setExtensionData( $extensionData)
Set extension data for this result.
getExtensionData()
Get the extension data as: augmentor name => data.