Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402652 )

Change subject: Fix return in PFTemplate and PFOpenLayersInput
......................................................................

Fix return in PFTemplate and PFOpenLayersInput

PFTemplate::loadTemplateFieldsSMWAndOther return void, no need for
another return
PFOpenLayersInput::parseCoordinatesString needs a return value, choose
null and moved the trim behind the check, because a null string could be
trimmed to an empty string

Change-Id: Id58350acfe01a3c92d9307a37ddf789c1405a94d
---
M .phpcs.xml
M includes/PF_Template.php
M includes/forminputs/PF_OpenLayersInput.php
3 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/52/402652/1

diff --git a/.phpcs.xml b/.phpcs.xml
index 4764e29..30ee060 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -18,7 +18,6 @@
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
                <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" 
/>
        </rule>
        <rule ref="MediaWiki.NamingConventions.PrefixedGlobalFunctions">
diff --git a/includes/PF_Template.php b/includes/PF_Template.php
index 6de0603..3483ee2 100644
--- a/includes/PF_Template.php
+++ b/includes/PF_Template.php
@@ -64,7 +64,7 @@
                                return;
                        }
                }
-               return $this->loadTemplateFieldsSMWAndOther();
+               $this->loadTemplateFieldsSMWAndOther();
        }
 
        /**
diff --git a/includes/forminputs/PF_OpenLayersInput.php 
b/includes/forminputs/PF_OpenLayersInput.php
index 99b836d..21492a5 100644
--- a/includes/forminputs/PF_OpenLayersInput.php
+++ b/includes/forminputs/PF_OpenLayersInput.php
@@ -202,12 +202,13 @@
         * Copied from CargoStore::parseCoordinateString() in the Cargo
         * extension.
         * @param string $coordinatesString
+        * @return string|null
         */
        public static function parseCoordinatesString( $coordinatesString ) {
-               $coordinatesString = trim( $coordinatesString );
                if ( $coordinatesString == null ) {
-                       return;
+                       return null;
                }
+               $coordinatesString = trim( $coordinatesString );
 
                // This is safe to do, right?
                $coordinatesString = str_replace( array( '[', ']' ), '', 
$coordinatesString );

-- 
To view, visit https://gerrit.wikimedia.org/r/402652
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id58350acfe01a3c92d9307a37ddf789c1405a94d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to