Return null from overwritten FormlessAction::onView
authorUmherirrender <umherirrender_de.wp@web.de>
Tue, 18 Jun 2019 19:10:39 +0000 (21:10 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Tue, 18 Jun 2019 19:10:39 +0000 (21:10 +0200)
The abstract class is documented to use null for doing nothing, not void

Change-Id: I99f0747117f83f4f2ae554c759a8e1737e7dc8f7

includes/actions/HistoryAction.php
includes/actions/RawAction.php

index 538b0a1..b1d5a50 100644 (file)
@@ -142,6 +142,7 @@ class HistoryAction extends FormlessAction {
 
        /**
         * Print the history page for an article.
+        * @return string|null
         */
        function onView() {
                $out = $this->getOutput();
@@ -151,7 +152,7 @@ class HistoryAction extends FormlessAction {
                 * Allow client caching.
                 */
                if ( $out->checkLastModified( $this->page->getTouched() ) ) {
-                       return; // Client cache fresh and headers sent, nothing more to do.
+                       return null; // Client cache fresh and headers sent, nothing more to do.
                }
 
                $this->preCacheMessages();
@@ -185,7 +186,7 @@ class HistoryAction extends FormlessAction {
                $feedType = $request->getRawVal( 'feed' );
                if ( $feedType !== null ) {
                        $this->feed( $feedType );
-                       return;
+                       return null;
                }
 
                $this->addHelpLink(
@@ -216,7 +217,7 @@ class HistoryAction extends FormlessAction {
                                ]
                        );
 
-                       return;
+                       return null;
                }
 
                $ts = $this->getTimestampFromRequest( $request );
@@ -300,6 +301,8 @@ class HistoryAction extends FormlessAction {
                        $pager->getNavigationBar()
                );
                $out->preventClickjacking( $pager->getPreventClickjacking() );
+
+               return null;
        }
 
        /**
index 505c9d5..3e4e614 100644 (file)
@@ -50,6 +50,7 @@ class RawAction extends FormlessAction {
 
        /**
         * @suppress SecurityCheck-XSS Non html mime type
+        * @return string|null
         */
        function onView() {
                $this->getOutput()->disable();
@@ -58,11 +59,11 @@ class RawAction extends FormlessAction {
                $config = $this->context->getConfig();
 
                if ( !$request->checkUrlExtension() ) {
-                       return;
+                       return null;
                }
 
                if ( $this->getOutput()->checkLastModified( $this->page->getTouched() ) ) {
-                       return; // Client cache fresh and headers sent, nothing more to do.
+                       return null; // Client cache fresh and headers sent, nothing more to do.
                }
 
                $contentType = $this->getContentType();
@@ -173,6 +174,8 @@ class RawAction extends FormlessAction {
                }
 
                echo $text;
+
+               return null;
        }
 
        /**