* Get the Limit report for page previews
*
* @since 1.22
- * @param ParserOutput $output ParserOutput object from the parse
+ * @param ParserOutput|null $output ParserOutput object from the parse
* @return string HTML
*/
- public static function getPreviewLimitReport( $output ) {
+ public static function getPreviewLimitReport( ParserOutput $output = null ) {
global $wgLang;
if ( !$output || !$output->getLimitReportData() ) {
* @since 1.24
* @param ParserOutput $parserOutput
*/
- public function addParserOutputMetadata( $parserOutput ) {
+ public function addParserOutputMetadata( ParserOutput $parserOutput ) {
$this->mLanguageLinks =
array_merge( $this->mLanguageLinks, $parserOutput->getLanguageLinks() );
$this->addCategoryLinks( $parserOutput->getCategories() );
* @param ParserOutput $parserOutput
* @param array $poOptions Options to ParserOutput::getText()
*/
- public function addParserOutputContent( $parserOutput, $poOptions = [] ) {
+ public function addParserOutputContent( ParserOutput $parserOutput, $poOptions = [] ) {
$this->addParserOutputText( $parserOutput, $poOptions );
$this->addModules( $parserOutput->getModules() );
* @param ParserOutput $parserOutput
* @param array $poOptions Options to ParserOutput::getText()
*/
- public function addParserOutputText( $parserOutput, $poOptions = [] ) {
+ public function addParserOutputText( ParserOutput $parserOutput, $poOptions = [] ) {
$text = $parserOutput->getText( $poOptions );
// Avoid PHP 7.1 warning of passing $this by reference
$outputPage = $this;
* @param ParserOutput $parserOutput
* @param array $poOptions Options to ParserOutput::getText()
*/
- function addParserOutput( $parserOutput, $poOptions = [] ) {
+ function addParserOutput( ParserOutput $parserOutput, $poOptions = [] ) {
$this->addParserOutputMetadata( $parserOutput );
$this->addParserOutputText( $parserOutput, $poOptions );
}
* @return array The policy that should be set
* @todo actions other than 'view'
*/
- public function getRobotPolicy( $action, $pOutput = null ) {
+ public function getRobotPolicy( $action, ParserOutput $pOutput = null ) {
global $wgArticleRobotPolicies, $wgNamespaceRobotPolicies, $wgDefaultRobotPolicy;
$ns = $this->getTitle()->getNamespace();
* @param string|null $cacheTime TS_MW timestamp when the cache was generated
* @param int|null $revId Revision ID that was parsed
*/
- public function save( $parserOutput, $page, $popts, $cacheTime = null, $revId = null ) {
+ public function save(
+ ParserOutput $parserOutput,
+ $page,
+ $popts,
+ $cacheTime = null,
+ $revId = null
+ ) {
$expire = $parserOutput->getCacheExpiry();
if ( $expire > 0 && !$this->mMemc instanceof EmptyBagOStuff ) {
$cacheTime = $cacheTime ?: wfTimestampNow();