Andreasburmeister has submitted this change and it was merged.

Change subject: Reduce nesting
......................................................................


Reduce nesting

Change-Id: Ia7022c78ee0f244949f8739eb6e60bf57461da41
---
M includes/ConstraintCheck/Helper/ConstraintReportHelper.php
1 file changed, 12 insertions(+), 12 deletions(-)

Approvals:
  Andreasburmeister: Verified; Looks good to me, approved



diff --git a/includes/ConstraintCheck/Helper/ConstraintReportHelper.php 
b/includes/ConstraintCheck/Helper/ConstraintReportHelper.php
index 03ccec2..1c8a281 100644
--- a/includes/ConstraintCheck/Helper/ConstraintReportHelper.php
+++ b/includes/ConstraintCheck/Helper/ConstraintReportHelper.php
@@ -44,19 +44,19 @@
        private function parseParameter( $parameter, $type = 'String' ) {
                if ( $parameter === null ) {
                        return 'null';
-               } else {
-                       if ( $type === 'String' ) {
-                               return "$parameter";
-                       } else { // ItemId, PropertyId
-                               $startsWith = strtoupper( substr( $parameter, 
0, 1 ) );
-                               if ( $startsWith === 'Q' || $startsWith === 'P' 
) {
-                                       $type = 'Wikibase\\DataModel\\Entity\\' 
. $type;
-                                       return new $type( $parameter );
-                               } else {
-                                       return '';
-                               }
-                       }
                }
+
+               if ( $type === 'String' ) {
+                       return "$parameter";
+               }
+
+               $startsWith = strtoupper( substr( $parameter, 0, 1 ) );
+               if ( $startsWith === 'Q' || $startsWith === 'P' ) {
+                       $type = 'Wikibase\\DataModel\\Entity\\' . $type;
+                       return new $type( $parameter );
+               }
+
+               return '';
        }
 
        /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia7022c78ee0f244949f8739eb6e60bf57461da41
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikidataQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: Andreasburmeister <andreas.burmeis...@student.hpi.de>

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

Reply via email to