X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcontent%2FAbstractContent.php;h=733d85a0655bfc3cecb885b51e54334fa0ae2622;hb=7960d5385f1146459671148e2e34d3ba50e17aeb;hp=b21eadcd14f36d968da3056d3e94121e744ea5ee;hpb=621d00d59bf589d17cf3fa1d18fe55ad5aa91812;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/content/AbstractContent.php b/includes/content/AbstractContent.php index b21eadcd14..733d85a065 100644 --- a/includes/content/AbstractContent.php +++ b/includes/content/AbstractContent.php @@ -43,7 +43,7 @@ abstract class AbstractContent implements Content { protected $model_id; /** - * @param string $modelId + * @param string|null $modelId * * @since 1.21 */ @@ -145,7 +145,7 @@ abstract class AbstractContent implements Content { /** * @since 1.21 * - * @param string $format + * @param string|null $format * * @return string * @@ -182,7 +182,7 @@ abstract class AbstractContent implements Content { /** * @since 1.21 * - * @param Content $that + * @param Content|null $that * * @return bool * @@ -219,9 +219,9 @@ abstract class AbstractContent implements Content { * @since 1.21 * * @param Title $title - * @param Content $old + * @param Content|null $old * @param bool $recursive - * @param ParserOutput $parserOutput + * @param ParserOutput|null $parserOutput * * @return DataUpdate[] * @@ -501,10 +501,11 @@ abstract class AbstractContent implements Content { ParserOptions $options = null, $generateHtml = true ) { if ( $options === null ) { - $options = $this->getContentHandler()->makeParserOptions( 'canonical' ); + $options = ParserOptions::newCanonical( 'canonical' ); } $po = new ParserOutput(); + $options->registerWatcher( [ $po, 'recordOption' ] ); if ( Hooks::run( 'ContentGetParserOutput', [ $this, $title, $revId, $options, $generateHtml, &$po ] ) @@ -518,6 +519,7 @@ abstract class AbstractContent implements Content { } Hooks::run( 'ContentAlterParserOutput', [ $this, $title, $po ] ); + $options->registerWatcher( null ); return $po; }