jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/352124 )

Change subject: Streamline HTML generation code in SpecialConstraintReport
......................................................................


Streamline HTML generation code in SpecialConstraintReport

"Html::openElement + raw HTML + Html::closeElement" really is the same as
Html::rawElement.

Warning: I'm not sure if it's correct to use Html::rawElement in all these
cases! It might be that some need HTML escaping and must use Html::element
because of this. But if such cases exist they are not introduced by this bug,
and should be fixed in a later one.

Change-Id: I53dbef8ae2e8aa1cdb0d90650499d3cf15b3f536
---
M specials/SpecialConstraintReport.php
1 file changed, 22 insertions(+), 24 deletions(-)

Approvals:
  Lucas Werkmeister (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/specials/SpecialConstraintReport.php 
b/specials/SpecialConstraintReport.php
index c3b9358..b6bd285 100644
--- a/specials/SpecialConstraintReport.php
+++ b/specials/SpecialConstraintReport.php
@@ -298,8 +298,7 @@
                        $cssClasses .= ' wbqc-constraintreport-notice-error';
                }
 
-               return
-                       Html::element(
+               return Html::rawElement(
                                'p',
                                [
                                        'class' => $cssClasses
@@ -312,14 +311,17 @@
         * @return string HTML
         */
        private function getExplanationText() {
-               return
-                       Html::openElement( 'div', [ 'class' => 
'wbqc-explanation' ] )
-                       . $this->msg( 
'wbqc-constraintreport-explanation-part-one' )->escaped()
-                       . Html::closeElement( 'div' )
+               return Html::rawElement(
+                               'div',
+                               [ 'class' => 'wbqc-explanation' ],
+                               $this->msg( 
'wbqc-constraintreport-explanation-part-one' )->escaped()
+                       )
                        . Html::element( 'br' )
-                       . Html::openElement( 'div', [ 'class' => 
'wbqc-explanation' ] )
-                       . $this->msg( 
'wbqc-constraintreport-explanation-part-two' )->escaped()
-                       . Html::closeElement( 'div' );
+                       . Html::rawElement(
+                               'div',
+                               [ 'class' => 'wbqc-explanation' ],
+                               $this->msg( 
'wbqc-constraintreport-explanation-part-two' )->escaped()
+                       );
        }
 
        /**
@@ -436,10 +438,11 @@
                                                           
$this->entityIdLinkFormatter->formatEntityId( $entityId ),
                                                           htmlspecialchars( 
$entityId->getSerialization() ) );
 
-               return
-                       Html::openElement( 'h3' )
-                       . sprintf( '%s %s', $this->msg( 
'wbqc-constraintreport-result-headline' )->escaped(), $entityLink )
-                       . Html::closeElement( 'h3' );
+               return Html::rawElement(
+                       'h3',
+                       [],
+                       sprintf( '%s %s', $this->msg( 
'wbqc-constraintreport-result-headline' )->escaped(), $entityLink )
+               );
        }
 
        /**
@@ -465,12 +468,8 @@
                                        . $count;
                        }
                }
-               $summary =
-                       Html::openElement( 'p' )
-                       . implode( ', ', $statusElements )
-                       . Html::closeElement( 'p' );
 
-               return $summary;
+               return Html::rawElement( 'p', [], implode( ', ', 
$statusElements ) );
        }
 
        /**
@@ -513,12 +512,11 @@
                        $tooltipContent
                );
 
-               return
-                       Html::openElement(
-                               'span'
-                       )
-                       . sprintf( '%s %s %s', $content, $tooltipIndicator, 
$tooltip )
-                       . Html::closeElement( 'span' );
+               return Html::rawElement(
+                       'span',
+                       [],
+                       sprintf( '%s %s %s', $content, $tooltipIndicator, 
$tooltip )
+               );
        }
 
        /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I53dbef8ae2e8aa1cdb0d90650499d3cf15b3f536
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to